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

How to collapse/expand groups in code

3 Answers 642 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Konrad Sikorski
Top achievements
Rank 1
Konrad Sikorski asked on 13 Jun 2012, 08:24 AM

Hi,

I have application which contains only RadGridView. Items in this grid are grouped by one of entity property. I would like to remember which group is collapsed and when application will be run again, automatically collapse these rows. In other words I want to remember last application state.

Thank you for any suggestions.

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 13 Jun 2012, 08:40 AM
Hello,

 You could use the ExpandGroup method of the RadGridView to expand the saved group.

Regards,
Didie
the Telerik team

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

0
Konrad Sikorski
Top achievements
Rank 1
answered on 07 Sep 2012, 10:15 PM
To use ExpandGroup I need to check which group is Expanded. I can use gridControl.Items.Groups but this objects don't have property IsExpanded. How can I do that?
0
Einar
Top achievements
Rank 1
answered on 24 Aug 2015, 07:31 PM

[quote]Konrad Sikorski said:To use ExpandGroup I need to check which group is Expanded. I can use gridControl.Items.Groups but this objects don't have property IsExpanded. How can I do that?[/quote]

Items.Groups[index] returns object, so you need to cast it to IGroup.

 If you wanted to expand a group you'd do:

grid.ExpandGroup((IGroup)grid.Items.Groups[0]);​
grid.ExpandGroup((IGroup)grid.Items.Groups[0]);​

Tags
GridView
Asked by
Konrad Sikorski
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Konrad Sikorski
Top achievements
Rank 1
Einar
Top achievements
Rank 1
Share this question
or