I have these values in a DataTable:
I initialize my Engine and Table like this:
this.m_Engine = new Engine();
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:
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?
ADAdministrator Syncfusion Team August 3, 2005 02: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
//g.Groups is populated