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.

Getting record in gridgroupingcontrol

Thread ID:

Created:

Updated:

Platform:

Replies:

35893 Oct 12,2005 04:26 PM Oct 12,2005 04:57 PM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On October 12, 2005 04:26 PM

In the TableControlCellDrawn in the gridgroupingcontrol I am trying to draw a custom cell placing multiple images in it. The images drawn are based on values with the datarow associated with the cell being drawn. So using the e.Inner.RowIndex how would I get the Table.Records[WHAT GOES HERE].

Administrator [Syncfusion]
Replied On October 12, 2005 04:49 PM

Nevermind: Table table = e.TableControl.Table; Element el = table.DisplayElements[e.Inner.RowIndex]; Record r = el.ParentRecord;

Administrator [Syncfusion]
Replied On October 12, 2005 04:57 PM

If you want to get the actual record, you can use code like this.
private void gridGroupingControl1_TableControlCellDrawn(object sender, GridTableControlDrawCellEventArgs e)
{
	GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;
	GridRecord record = style.TableCellIdentity.DisplayElement.GetRecord() as GridRecord;
	if(record != null)
	{
		Console.WriteLine(record);
	}
}
If you really want the index, then you can get the record as above, and then call grid.Table.Records.IndexOf(record) to get the index.

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.

;