How to retrieve the datarow from GridDataBoundGrid with multiple hierarchy levels.

Hi all,

I've created a master-detail view in GridDataBoundGrid with GridHierarchyLevel. Can anyone tell me how to retrieve the datarow from the current cell clicked?

Thanks.


1 Reply

AD Administrator Syncfusion Team November 28, 2007 09:49 AM UTC

One way you can do this is through the GridBoundRecordState object for the row.

GridCurrentCell cc = gridDataBoundGrid1.CurrentCell;

GridBoundRecordState rs = gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(cc.RowIndex);
if (rs.Position < rs.Table.Count)
{
DataRowView drv = rs.Table[rs.Position] as DataRowView;
if (drv != null)
{
this.Text = drv[0].ToString() + " " + drv[1].ToString();
}
}




Loader.
Up arrow icon