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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

70122 Nov 28,2007 08:37 AM UTC Nov 28,2007 09:49 AM UTC Windows Forms 1
loading
Tags: GridControl
Keping Wu
Asked On November 28, 2007 08:37 AM UTC

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.


Administrator [Syncfusion]
Replied On 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();
}
}




CONFIRMATION

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.

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

;