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

QueryCellStyleInfo, e.TableCellIdentity.RowIndex includes group headers

Thread ID:





120622 Sep 28,2015 02:26 PM UTC Sep 29,2015 06:39 AM UTC WinForms 1
Tags: GridGroupingControl
Asked On September 28, 2015 02:26 PM UTC

When I use the QueryCellStyleInfo event, e.TableCellIdentity.RowIndex gives me the row index of the currently evaluated cell in the grid, however this is the row index _including_ group headers.
(For example, my data table has 20 records and gets grouped into three sections, so the total number of rows in the grid is 23.)

When I compare this row index to the collection GridGroupingControl.Table.Records, it does not fit, because GridGroupingControl.Table.Records only iterates through the 20 "real" records of the grid and not through the three group headers.
(I want to know the values in other columns of the same row.)

How, then, can I get row values at other columns given the row index from e.TableCellIdentity.RowIndex?

Thanks a lot,

Adhikesevan Kothandaraman [Syncfusion]
Replied On September 29, 2015 06:39 AM UTC

Hi Anne,

Thanks for contacting Syncfusion Support.

If you are using the QueryCellInfo event to get the record value, it can be achieved by getting the display element of the current record. The event argument of the QueryCellInfo  has the style object ”e”, we can get the display element by using the e.TableCellIndentity.DisplayElement . Please refer to the following code example,

Code Example:

void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)


    if (e.TableCellIdentity.RowIndex == 20)


        Element el = e.TableCellIdentity.DisplayElement as Element;

        if (el != null && e.TableCellIdentity.TableCellType == Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellType.RecordFieldCell)


            string fieldValue = el.ParentRecord.GetValue("City").ToString();




Suggestion 2:

this.gridGroupingControl1.TableControlCellMouseDown += gridGroupingControl1_TableControlCellMouseDown;

//Get the record value using the row index

void gridGroupingControl1_TableControlCellMouseDown(object sender, GridTableControlCellMouseEventArgs e)


    GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);

    Element el = style.TableCellIdentity.DisplayElement;

    if(el != null && el.ParentRecord !=null)


        Record record = el.ParentRecord as Record;







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