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

How to get all the GridRecords that belong to a GridCaptionSection groups

Thread ID:





55102 Jan 23,2007 10:19 PM UTC Jan 24,2007 12:32 AM UTC WinForms 3
Tags: Grouping
James Blibo
Asked On January 23, 2007 10:19 PM UTC

I have a single flat datasource that is bound to a ggc.
The ggc is is grouped via..


.. hence, my ggc looks like this..


Normally, the GridCaptionCell will display the group name with the number of items, for example ' : 12 items, for example.

My issue is, when the GroupCaptionCell is the currentactivecell, how do i get all the GridRecords that belong to this grouping.

The user wants to right-click on a group and perform an action, for example, delete all the records that below to this grouping.

Administrator [Syncfusion]
Replied On January 23, 2007 11:50 PM UTC

Hi James,

Here is a code snippet that shows you how to get all the GridRecords that belong to a GridCaptionSection in a TableControlCurrentCellActivated event.

private void gridGroupingControl1_TableControlCurrentCellActivated(object sender, GridTableControlEventArgs e)
GridCurrentCell cc= e.TableControl.CurrentCell;
Element el = e.TableControl.Table.DisplayElements[cc.RowIndex];
if( el.Kind == DisplayElementKind.Caption )
if( el.ParentGroup != null
&& el.ParentGroup.ParentChildTable != null)
foreach(Record rec in el.ParentGroup.Records)

Please refer to the attached sample for implementation.

Best Regards,

James Blibo
Replied On January 24, 2007 12:16 AM UTC


One more question... What if the current cell is a GridRecord? How would you access the GridRecord from this same event 'TableControlCurrentCellActivated'?

James Blibo
Replied On January 24, 2007 12:32 AM UTC

never mind... found it..

if (el.Kind == DisplayElementKind.Record && el.ParentTable != null)
Record r = el.ParentTable.CurrentRecord;


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