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. Image for the cookie policy date
close icon

Converted rowindex to bound data row index for nested table

Hello,

I have multiple DataTables bound to GGC to show nested tables.

In the _CellButtonClicked() event, there is a e.RowIndex parameter. This row index appears to be based on the current state of the grid UI, which can change if for example, a nested table above the row in question is expanded.

How do you convert this e.RowIndex to a data row index which can be used to retrieve reference to the corresponding bound data row?

e.g. TableControl.Table.Records[dataRowIndex]

Thank you!

1 Reply

AD Administrator Syncfusion Team November 16, 2006 04:14 AM UTC

Hi Gah,

Below code snippet shows you how to get the recordindex if the rowindex is known.

// Recordindex is being calculated.
GridTable table = e.TableCellIdentity.Table;
Element el = table.DisplayElements[RowIndex];
Record r = el.ParentRecord;
int RecordIndex= table.UnsortedRecords.IndexOf(r);

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon