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

How do I know which group the selected row is in

1 Answer 30 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Helen
Top achievements
Rank 2
Helen asked on 21 Jan 2011, 01:11 AM
How can I tell whether a specific row is in a group, and expand that group?

Thanks

Helen

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 27 Jan 2011, 05:56 PM

Hi Helen,

Excuse me for the delay. The following snippet show how you can retrieve the group for an item and expand the respective group.

Hope this helps.

private void Button1_Click(object sender, RoutedEventArgs e)
{
    var itemTofind = this.playersGrid.Items[2];
    var group = this.playersGrid.Items.Groups
        .OfType<IGroup>()
        .Where(g => g.Items.OfType<object>().Contains(itemTofind)).FirstOrDefault();
  
    this.playersGrid.ExpandGroup(group);
}
 



Greetings,
Milan
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
GridView
Asked by
Helen
Top achievements
Rank 2
Answers by
Milan
Telerik team
Share this question
or