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

Get the selected child row not the parent in a hierarchical grid

1 Answer 113 Views
GridView
This is a migrated thread and some comments may be shown as answers.
gimi
Top achievements
Rank 1
gimi asked on 15 Jul 2009, 02:08 PM
I have a RadGridView in a hierarchical view.

Double-clicking on a child row and checking the RadGridViw.SelectedItem I get the parent row. Any idea how I can get the selected child item not the parent?

Thanks,
Mihai.

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 17 Jul 2009, 06:23 AM
Hi gimi,

You can subscribe to the SelectionChanged event and check if the DataControl property is different from your master grid - if it is than a child item was selected and you can get that item by using the other event arg properties like AddedRecord, AddedItems, etc.
Here is a snippet:

void RadGridView1_SelectionChanged(object sender, SelectionChangeEventArgs e)  
{  
    if (e.DataControl != this.RadGridView1)  
    {  
        // child row was selected  
    }  


Regards,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
gimi
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or