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

Row numbers in Goruping Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

27980 Apr 21,2005 05:36 AM UTC Apr 21,2005 07:57 AM UTC Windows Forms 1
loading
Tags: Grouping
Sameer Patil
Asked On April 21, 2005 05:36 AM UTC

Hi Is there a way to display row numbers in the grouping grid? Thanks Sameer

Administrator [Syncfusion]
Replied On April 21, 2005 07:57 AM UTC

One way you can do this is to handle the QueryCellStyleInfo event and set the row header text there.
//in form.load
this.grid.QueryCellStyleInfo += new GridTableCellStyleInfoEventHandler(grid_QueryCellStyleInfo);
this.grid.TableOptions.RowHeaderWidth = 30; 

//the handler
private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
	if(e.TableCellIdentity.TableCellType == GridTableCellType.RecordRowHeaderCell
		|| e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordRowHeaderCell)
	{
		e.Style.CellType = "Header";
		e.Style.CellValue = this.gridGroupingControl1.Table.FilteredRecords.IndexOf((e.TableCellIdentity.DisplayElement as GridRecordRow).ParentRecord) + 1;
	}
}

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

;