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

GroupDescriptors and Groups

3 Answers 120 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 01 Feb 2016, 07:21 PM

Hello,

I'm trying to figure out how to relate GroupDescriptors that I add to my Grid with the Groups that get created from them.  I essentially want to say "Group my Grid by column X (using a ColumnGroupDescriptor), and have that group be expanded by default."  I don't want *all* groups to be expanded by default, though, just specific ones.

I see that there is an ExpandGroup() method exposed off of GridView that can expand individual groups for me, but I don't see how the actual groups in GridView.Items.Groups are related to the GroupDescriptors used to create them.

 Is there a good way for me to accomplish this?

 

Thanks,

Ryan

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 04 Feb 2016, 02:46 PM
Hello Ryan,

In order to guide you accordingly, can you please clarify whether you need to expand a particular group/groups, or just the groups created by a given ColumnGroupDescriptor?

Best Regards,
Stefan X1
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Ryan
Top achievements
Rank 1
answered on 04 Feb 2016, 03:27 PM

Hi Stefan,

I need to have all groups for a given ColumnGroupDescriptor expanded by default, not a particular group/groups.

 

0
Accepted
Stefan
Telerik team
answered on 08 Feb 2016, 11:54 AM
Hello Ryan,

Thank you for clarifying this.

I am afraid that there is no out-of-the-box mechanism for such scenario.

However, a possible solution might be to use the fact, that the index each IGroupDescriptor within the GroupDescriptors collection of RadGridView, corresponds to a given level of IGroups from the Items.Groups collection of the control. In other words said, they are added in the same order and this order is kept irrelevant to how many nested groups are defined.

So, having the index of a given ColumnGroupDescriptor, you should be able to traverse down to the relevant level of IGroups through the Subgroups collection of each IGroup.

I hope this suggestion fits your requirements. Let me know in case you need further assistance.

All the best,
Stefan X1
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Ryan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or