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

get a reference to the rowdetails of a selected row

2 Answers 37 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jorge Alberto
Top achievements
Rank 1
Jorge Alberto asked on 20 Jul 2010, 01:50 AM
Hello 

I want to know how can I get a reference to the rowdetails object of a selected row of a gridView.
Is it posible?
I hope you can help me

Best Regards
Jorge

2 Answers, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 20 Jul 2010, 06:48 AM
Hello Jorge Alberto,

You can use the ItemsGenerator got get the selected row and then use our ChildrenOfType extensions method to locate any element in the row details.

// using Telerik.Windows.Controls
private void Button1_Click(object sender, RoutedEventArgs e)
{
    var selectedRow = (GridViewRow)this.playersGrid.ItemContainerGenerator
        .ContainerFromItem(this.playersGrid.SelectedItem);
  
    var gridInRowDetails = selectedRow.ChildrenOfType<RadGridView>().FirstOrDefault();
      
}


Best wishes,
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
Jorge Alberto
Top achievements
Rank 1
answered on 20 Jul 2010, 09:21 AM
Hello Milan

Thank you very much for your answer.
It works perfectly :)

Best Regards,
Jorge
Tags
GridView
Asked by
Jorge Alberto
Top achievements
Rank 1
Answers by
Milan
Telerik team
Jorge Alberto
Top achievements
Rank 1
Share this question
or