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

[Solved] Get selected item of a subgrid

1 Answer 102 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Samuel
Top achievements
Rank 1
Samuel asked on 22 Sep 2011, 03:25 PM
Hello
I have a main grid, with a second one inside it...
I need to get the selected item inside the subgrid... How can I do that?

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 23 Sep 2011, 06:54 AM
Hello Samuel,

You can subscribe to the SelectionChanged event of the parent grid. This event will be fired for all inner grids as well and the last item in AddedItems collection will be the one you are looking for:

void clubsGrid_SelectionChanged(object sender, SelectionChangeEventArgs e)
        {
            Player selectedPlayer = e.AddedItems.LastOrDefault() as Player;
        }

 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Samuel
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or