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

Find the grid''s RowIndex of a DataRow from a nested DataTable

Thread ID:





49744 Sep 26,2006 07:44 AM UTC Sep 26,2006 09:48 AM UTC WinForms 2
Tags: GridControl
Timothy Duly
Asked On September 26, 2006 07:44 AM UTC

I have a set of 3 tables. One table is the root table and the others are subsequent child tables.
Root Table
¦-Child Table
¦-GrandChild Table

How is it possible to retrieve the grid''s RowIndex of a given DataRow from a nested table? I have tried to use PositionToRowIndex and similar functions but they simply return the rowIndex of the root table and not the child table.

The reason for this is that I am remembering the state of a grid (ie what rows where expanded/collapsed including nested tables) so that after a refresh I can set the grid back to the state that it was in before the refresh.

Your help in this matter would be most appreciated.

Administrator [Syncfusion]
Replied On September 26, 2006 09:25 AM UTC

Hi Tim,

You can get this from the GridBoundRecordState for the row. Here is some code snippet.

GridBoundRecordState rs = this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex( gridRowIndex );
int pos = rs.Position;
CurrencyManager cm = rs.ListManager as CurrencyManager;
if(cm != null)
DataView dv = cm.List as DataView;
if(dv != null)
DataRow dr = dv[pos].Row;
Console.WriteLine(dr[0].ToString() + " " + dr[1].ToString());

Best Regards,

Timothy Duly
Replied On September 26, 2006 09:48 AM UTC

How did you get the GridRowIndex in the first place? It is the RowIndex that I am trying to find.

Basically, I have a DataRow from a nested table that I have selected programmatically and not through clicking on the grid. I now need to find out the grid''s RowIndex of this DataRow.


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

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