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

Finding a Record from DataRow

Thread ID:

Created:

Updated:

Platform:

Replies:

81188 May 15,2009 08:16 AM May 18,2009 10:14 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 15, 2009 08:16 AM

I am using a GridGroupingControl. I use a DataTable as the DataSource for this grid. Is there a direct way of finding the Syncfusion Record from the DataRow of that DataTable?

Rajadurai C [Syncfusion]
Replied On May 18, 2009 10:14 AM

Hi Phani,

Thanks for your interest in Syncfusion products.

Please refer to the following code showing how to get the record value from the underlying data handled in QueryCellStyleInfo event.

void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
GridRecord record = e.TableCellIdentity.DisplayElement.GetRecord() as GridRecord;
if (record != null)
{
//to get the raw dataobject, ie the DataRowView from a DataTable datasource
//you can use
object data = record.GetData();
DataRowView drv = data as DataRowView;
if (drv != null)
{
Console.WriteLine("field0={0} field1={1}", drv[0], drv[1]);
}
}
}


Regards,
Rajadurai

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

;