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

Retrieve records of child table grouped by GroupedColumns

Thread ID:





120043 Aug 26,2015 12:51 PM UTC Sep 2,2015 12:26 PM UTC WinForms 5
Tags: GridGroupingControl
Asked On August 26, 2015 12:51 PM UTC

I have parent-child relationship in GGC. I have added a grouped column by which the relationship is showed in GGC.
I want to retrieve all records of grouped column when I double click on that grouped column.
I used GridTableModel, GridTableCellStyleInfo,GridTableCellStyleInfoIdentity to fetch records,but when I double clicked on grouped column, it gives null records.
Please give me any solution regarding to this.

Thank you and regards,

Adhikesevan Kothandaraman [Syncfusion]
Replied On August 28, 2015 01:21 AM UTC

Hi Rasika,

Thank you for your interest in Syncfusion products.

We have analyzed your reported scenario at our end. As per your scenario you are getting the records through GridTableCellIdentity. Instead of using that you can use the grid.Table.TopLevelControl.Groups to get the records from the groups. It will retrieve the records based on the grouped levels. Please refer the below codeSnippet,

Code Snippet:

//To get all the records of the group

string data = "";

for (int i = 0; i < this.gridGroupingControl1.Table.TopLevelGroup.Groups.Count; i++)


   for(int j=0;j<this.gridGroupingControl1.Table.TopLevelGroup.Groups[i].Records.Count;j++)


       data = this.gridGroupingControl1.Table.TopLevelGroup.Groups[i].Records[j].ToString()+"\n";


If the TopLevelGroup.Groups has the nested group then the records collection is available in the inner group of the Groups collection that is Groups[Index].Groups[InnerGroupIndex].Records has the record values.

Please let me know if you have any concern.


Replied On August 28, 2015 05:44 AM UTC

Thank you for reply.
But in my application I got this.gridGroupingControl1.Table.TopLevelGroup.Groups.Count = 0
So it finishes the for loop.
I have added grouped column 'Year' using following code. 
I am attaching 2 image files of my GGC. Please find the attachments.
In first image I want to double click on any of the year row.
If suppose I clicked on 'Year 2012' row then I want to fetch 9 records of that year as shown in the second image.
Please suggest any solution for this.

Thank you and regards,

Attachment: GGC_ScreenShots_13e5a863.rar

Adhikesevan Kothandaraman [Syncfusion]
Replied On August 31, 2015 11:07 AM UTC

Hi Rasika,

Thank you for your update.

We have analyzed your query at our end. If you want to get the records of the groups based on double click on the cell, you can achieve it by using the element.ParentGroup.Records. Please refer the below code example,,

Code Example:

GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
Element el = style.TableCellIdentity.DisplayElement;
if (el != null)
string s = "";
foreach (Record rec in el.ParentGroup.Records)
//Retrieves the Records of the parent group
s += rec.ToString() + Environment.NewLine;
//Shows the Content in the MessageBox



Replied On September 1, 2015 09:52 AM UTC

Thank you for reply.It works.
Thank you so much.


Ranjani Prabhakaran [Syncfusion]
Replied On September 2, 2015 12:26 PM UTC

Hi Rasika,
Thanks for the update.
Please let us know if you need any assistance.


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

or the page will be automatically redirected to 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