Skip to main content

Microsoft Silverlight

Answered Question Dynamic creation & binding of Silverlight datagridRSS Feed

(0)

oneone
oneone

Member

Member

15 points

31 Posts

Dynamic creation & binding of Silverlight datagrid

Hi, everyone :

i read this blog :http://blogs.msdn.com/deepak_verma/archive/2008/07/19/dynamic-creation-binding-of-silverlight-datagrid.aspx

it's work fine !

but, how to add other kind the component, like listbox.

 

And another question, i have ask already, but i still don't get it.

when i use datagrid like this, i don't know how to bind my data to listbox

and i can find the myDataGrid, but i can't find myListBox, can someone explain why and how, thanks.

<my:DataGrid x:Name="myDataGrid" Width="500" Height="500" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="Visible" >
    <my:DataGrid.Columns>
        <my:DataGridTextColumn Header="Name" DisplayMemberBinding="{Binding Name}" />
        <my:DataGridTextColumn Header="Ages" DisplayMemberBinding="{Binding Ages}" />

            <my:DataGridTemplateColumn >
                <my:DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <ListBox x:Name="myListBox" FontFamily="Arial" Margin="8" ItemsSource="{How to Binding ?}" />
                    </DataTemplate>
                </my:DataGridTemplateColumn.CellTemplate>
            </my:DataGridTemplateColumn>
    </my:DataGrid.Columns>
</my:DataGrid>

 

my English not good, hope you know what i am say, thanks for your help

Best regard !

preishuber
preishuber

Contributor

Contributor

3570 points

655 Posts

Answered Question

Re: Dynamic creation & binding of Silverlight datagrid

that blog entry should answere your question

 

http://weblogs.asp.net/manishdalal/archive/2008/09/28/combobox-in-datagrid.aspx

-Hannes

http://www.preishuber.net http://weblogs.asp.net/hpreishuber

oneone
oneone

Member

Member

15 points

31 Posts

Re: Re: Dynamic creation &amp; binding of Silverlight datagrid

 This is great !!

 Thanks

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities