Peter Meinl
                                            
                                    
    Top achievements
    
            
                
                Rank 1
            
    
                                        
                                        Peter Meinl
                                        asked on 08 Aug 2010, 05:07 PM
                                    
                                How can I get the values of the row selected in the child grid of a hierachical grid.
My hierarchical GridView is bound to the results of an OData service:
ApprovalRequests
..Approvals
In a button click event I want to access the selected values.
                                My hierarchical GridView is bound to the results of an OData service:
ApprovalRequests
..Approvals
In a button click event I want to access the selected values.
6 Answers, 1 is accepted
0
                                Accepted
Hi,
Vlad
the Telerik team
                                        Why not use MVVM instead? The approach demonstrated in this blog will work no matter if the grid is parent or child.
Sincerely yours,Vlad
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the 
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
                                
                                                    Peter Meinl
                                                    
                                            
    Top achievements
    
            
                
                Rank 1
            
    
                                                
                                                answered on 10 Aug 2010, 11:43 AM
                                            
                                        Thanks for your fast answer.
Using MVVM looked like too much code to me for simply getting the selected child row.
I replaced the hierarchical RadGridView with two synchronized standard DataGrids instead.
                                        Using MVVM looked like too much code to me for simply getting the selected child row.
I replaced the hierarchical RadGridView with two synchronized standard DataGrids instead.
0
                                
                                                    Anand
                                                    
                                            
    Top achievements
    
            
                
                Rank 1
            
    
                                                
                                                answered on 22 Sep 2010, 12:55 AM
                                            
                                        Is there another way to solve this issue with out using MVVM or going with two standard datagrids?
Thank you,
Happy
                                        Thank you,
Happy
0
                                Hi Anand,
Milan
the Telerik team
                                        There are several ways to get the selected items depending on your particular scenario. Are you using a button to retrieve the child selected items? When is the button placed - is it on the parent rows?
Kind regards,Milan
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the 
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
                                
                                                    Anand
                                                    
                                            
    Top achievements
    
            
                
                Rank 1
            
    
                                                
                                                answered on 23 Sep 2010, 07:01 PM
                                            
                                        Thank you for your response. 
Well I have Parent Grid which shows the list of Requests (Request Object --> which has a collection of Sample Objects); the child grid has the Sample Object. (I used the demo example and it works like a charm)
When I double click on the Parent grid I am supposed to pass the Request Object (row) to a Request screen and it handles updates etc (this is working), similarly on double click of the Child grid I would like to pass the Sample Object to a Sample screen and it handles updates etc; this is not happening - instead it gives the Request object (row) all the time. (btw I am using MouseDoubleClick Event).
Regards,
Anand
                                        Well I have Parent Grid which shows the list of Requests (Request Object --> which has a collection of Sample Objects); the child grid has the Sample Object. (I used the demo example and it works like a charm)
When I double click on the Parent grid I am supposed to pass the Request Object (row) to a Request screen and it handles updates etc (this is working), similarly on double click of the Child grid I would like to pass the Sample Object to a Sample screen and it handles updates etc; this is not happening - instead it gives the Request object (row) all the time. (btw I am using MouseDoubleClick Event).
Regards,
Anand
0
                                Hello Anand,
 
Greetings,
Milan
the Telerik team
                                        If you are using HierarchyChildTemplate or a RowDetailsTemplate you can easily subscribe to the RowActivated event of the child grid and retrieve the activated row. For example:
<telerik:RadGridView Grid.Row="0"                      Name="clubsGrid"                      ItemsSource="{Binding Clubs}"                      Margin="5">     <telerik:RadGridView.HierarchyChildTemplate>         <DataTemplate>             <telerik:RadGridView Name="playersGrid"                              ItemsSource="{Binding Players}"                                  RowActivated="playersGrid_RowActivated_1"/>                         </DataTemplate>     </telerik:RadGridView.HierarchyChildTemplate> </telerik:RadGridView> 
private void playersGrid_RowActivated_1(object sender, RowEventArgs e) {     var clickedDataItem = e.Row.DataContext;       // process item }Hope this works.
Greetings,
Milan
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the 
Telerik Public Issue Tracking
system and vote to affect the priority of the items
