Working with collapsed/Expanded Groups

Hi,
I have a GGC which has records that are grouped by some Column.. Among the different groups, a few groups are collapsed and a few are expanded..
1. How do I get the list of Groups? Collapsed and Expanded?
2. How can I collapse or Expand a particular group?

1 Reply

HA haneefm Syncfusion Team April 24, 2007 06:26 PM UTC

Hi Raj,

1. How do I get the list of Groups? Collapsed and Expanded?
>>>>>

Here is a code snippet that shows you "How to access all the groups and the records categorized under it?".

this.iterate(this.gridGroupingControl1.Table.TopLevelGroup);

public void iterate(Group g)
{
System.Diagnostics.Trace.WriteLine("GroupLevel = "+g.GroupLevel);
System.Diagnostics.Trace.WriteLine(g.Info);
foreach(Record r in g.Records)
{
System.Diagnostics.Trace.WriteLine(r.Info);
}
foreach(Group gr in g.Groups)
{
iterate(gr);
}
}

2. How can I collapse or Expand a particular group?
>>>>>

Use the IsExpanded property to expand/collapse the group in grid. Here is a code snippet to expand the toplevel group in a grid.

this.gridGroupingControl1.Table.TopLevelGroup.IsExpanded = true;
this.gridGroupingControl1.Table.TopLevelGroup.IsExpanded = false;

Best regards,
Haneef

Loader.
Up arrow icon