This is a migrated thread and some comments may be shown as answers.

Child Grid in silverlight

1 Answer 27 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Ramyashree
Top achievements
Rank 1
Ramyashree asked on 21 Jan 2011, 11:10 AM
Hi,

I have a Grid which displays a selected fields of an object... The code snippet for grid is as follows...

<telerik:RadGridView   RowDetailsVisibilityMode="VisibleWhenSelected" 
                                         Name="radGridViewCountry" Height="300" 
                                         ItemsSource="{Binding Mode=TwoWay,
                                         Path=CountrySource}"                                            
                                         AutoGenerateColumns="False"                                          
                                         SelectionMode="Single"  
                                         >
 
I also have a rowdetails template  as below using which I can display some additional fields of the same itemsource...

<telerik:RadGridView.RowDetailsTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" 
                                     Margin="10,10,10,10">                                                           
                                    <TextBlock Text="ID: " />
                                    <TextBlock Text="{Binding ID}" />
                                     <TextBlock Text="Country: " />
                                    <TextBlock Text="{Binding Name}" />
                              </StackPanel>
                            </DataTemplate> </telerik:RadGridView.RowDetailsTemplate>

I want to achieve the same thing using a child grid ,Iis that possible...? I tried the three examples given in the demos but not able to do what i actually wanted.... Any help would be appreciated..

Thanks and Regds.,
Ramya

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 21 Jan 2011, 11:16 AM
Hello Ramyashree,

It is possible. You have to place two grids on the page. The first one will be the master grid and it will be bound to the collection containing the master entities, let's say football clubs.

Suppose each football club POCO has a collection property called Players, which are also POCO's. You can then bind the second grid's ItemsSource to the first grid's SelectedItem.Players.

In this way, each time you select a different club in the master grid, the child grid will display the players for the selected club.

I hope this helps.

Best wishes,
Ross
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
DataPager
Asked by
Ramyashree
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or