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.

GridDataBoundControl

Thread ID:

Created:

Updated:

Platform:

Replies:

47402 Aug 3,2006 06:03 PM Aug 4,2006 02:04 AM Windows Forms 2
loading
Tags: GridControl
Ken
Asked On August 3, 2006 06:03 PM

I have GridDataBoundGrid with two level.
How can I reference back to the datarow when user click on second level row or any row.

In grid grouping control, there is GridTableCellStyleInfoEventArgs.TableIdentity.Table.DisplayElement[index]
to reference back to GridRecordRow and then DataRowView.
What about GridDataBoundGrid?

Thanks

Administrator [Syncfusion]
Replied On August 4, 2006 01:56 AM

Hi Ken,

The GridDataBoundGrid is bound to the datasource using the CurrencyManager, using the CurrenCyManager the current record''s corresponding row index can be retrieved. Try the code snippet below.

GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
CurrencyManager cm = (CurrencyManager) this.BindingContext[this.gridDataBoundGrid1.DataSource, this.gridDataBoundGrid1.DataMember];
DataRowView dv = (DataRowView) this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(cc.RowIndex).ListManager.Current;
Console.WriteLine(dv[1].ToString());

Regards,
Rajagopal

Administrator [Syncfusion]
Replied On August 4, 2006 02:04 AM

Hi Ken,

Sorry for the inconvenience. Please follow the code snippet below.

GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
DataRowView dv = (DataRowView) this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(cc.RowIndex).ListManager.Current;

Console.WriteLine(dv[1].ToString());

Thanks,
Rajagopal

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.

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.

;