We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How can I retrieve Groups in GridGroupingControl

Is it possible to iterate through GridGroupingControl's groups? How can I get group count

Thanks
Lalitha


1 Reply

YV Yuvaraja V Syncfusion Team January 19, 2011 12:53 PM UTC

Hi Lalitha,

Thanks for your interest in Syncfusion Products.

1.To get the groups count, You could make use of the property "Groups.Count".The following code illustrates the same.

void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex,e.Inner.ColIndex);
if (style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell)
{
Group g = style.TableCellIdentity.DisplayElement.ParentGroup;
MessageBox.Show(g.Groups.Count.ToString());
}
}


2.Yes, Its possible to iterate through GridGroupingControl groups, You could make use of the property "Table.Elements and Table.NestedElements" to retrieve the records in Tables.

Here is the sample for your reference.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=New Folder (81)-1920022134.zip

For more information about the "Iterate Through Elements" in Table.Please refer the "Iterate Through Elements Demo" sample shipped via the Essential studio for the implementation.The path for the sample is as follows.

Path:
{Installed Drive}:\Syncfusion\Version\Windows\Grid.Grouping.Windows\Samples\2.0\Grouping Architecture\Iterate Through Elements Demo\CS

Please let us know if this helps.

Regards,
Yuvaraja V.



Loader.
Live Chat Icon For mobile
Up arrow icon