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. Image for the cookie policy date

Getting record in gridgroupingcontrol

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].

2 Replies

AD Administrator Syncfusion Team October 12, 2005 08:49 PM UTC

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


AD Administrator Syncfusion Team October 12, 2005 08:57 PM UTC

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.

Loader.
Live Chat Icon For mobile
Up arrow icon