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.
Unfortunately, activation email could not send to your email. Please try again.

How to iterate grouped values?

Thread ID:

Created:

Updated:

Platform:

Replies:

32534 Aug 2,2005 07:33 PM Aug 3,2005 03:46 PM Windows Forms 2
loading
Tags: Grouping
Sean Greer
Asked On August 2, 2005 07:33 PM

I have these values in a DataTable: ZipCode City 93512 Bishop 93514 Bishop 93515 Bishop I initialize my Engine and Table like this: this.m_Engine = new Engine(); this.m_Engine.SetSourceList(this.ZipTable.DefaultView); this.m_Engine.RecordAsDisplayElements = true; this.m_Table = this.m_Engine.Table; I then want to change the grouping to be by city, so I do this: this.m_Table.TableDescriptor.GroupedColumns.Add("City"); I now want to iterate the Records (or Elements?) and have it return to me one row for each grouping level. What collection should I be accessing on the Table object to return that list? Thanks, Sean

Administrator [Syncfusion]
Replied On August 3, 2005 03:48 AM

Under a group, there may be either records or sub-groups. So a group has two properties, group.Groups and group.Records. Only one of these collections is non-null. If the group.Records != null, then the group is showing records and you can iterate through group.Records. If the group.Records is null, then group.Groups should be not null, and you can iterate through that collection. The entries in group.Groups will be a Group object, and you can use their .Category property to see the grouped key.
Group g = this.gridGroupingControl1.Table.TopLevelGroup;
if(g.Records != null)
{
	//g.Records is populated
}
else
{
	//g.Groups is populated
}

Sean Greer
Replied On August 3, 2005 03:46 PM

That was just what I needed. Thanks Clay.

CONFIRMATION

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.

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.

;