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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Retrieving a group''s records in GroupedColumns.Changed event

Thread ID:





94820 Jun 3,2010 03:07 PM UTC Jun 8,2010 05:45 AM UTC WinForms 1
Tags: Grouping
Administrator [Syncfusion]
Asked On June 3, 2010 03:07 PM UTC


I am using GridGroupingControl v6.303.0.6.

Whenever the user adds or removes a group, I need to retrieve the groups and their Records.

I have a handler attached to the GridGroupingControl.TableDescriptor.GroupedColumns.Changed event. In the handler, I get the groups/Records from GridGroupingControl.Table.TopLevelGroup.Groups. I then recursively iterate the Groups (and their sub-groups, etc..), and process their Records.

Unfortunately, during the GroupedColumns.Changed event the TopLevelGroup.Groups collection has not been updated to include the user's changes yet.

Is there anyway I can get the "up to date" groups/records while handling a GridGroupingControl.TableDescriptor.GroupedColumns.Changed event? Or is there another event I could use?

Currently, as a workaround, I do Thread.Sleep(100) in a background thread, and then invoke back into the UI thread. By then the TopLevelGroup collection is up to date. But this hack makes my stomach hurt :)

Jisha Joy [Syncfusion]
Replied On June 8, 2010 05:45 AM UTC

Hi Richard,

Thank you for using Syncfusion products.

You could check the e.Action and iterate though the groups to get the uptodate groups. See the code to iterate though the toplevelgroups.

void GroupedColumns_Changed(object sender, Syncfusion.Collections.ListPropertyChangedEventArgs e)
if(e.Action== Syncfusion.Collections.ListPropertyChangedType.Insert || e.Action == Syncfusion.Collections.ListPropertyChangedType.Remove)
Group grp = this.gridGroupingControl1.Table.TopLevelGroup;
DetailsSection ds = grp.Details;
if (ds is GridRecordsDetails)
GridRecordsDetails grd = ds as GridRecordsDetails;
foreach (Record r2 in grd.Records)
Console.WriteLine("* " + r2.ToString());
if (ds is GridGroupsDetails)
GridGroupsDetails ggd = ds as GridGroupsDetails;
foreach (Group g in ggd.Groups)
Console.WriteLine("+ " + g.ToString());



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon