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 header to display line numbers

Thread ID:

Created:

Updated:

Platform:

Replies:

52552 Nov 30,2006 09:39 AM UTC Nov 30,2006 10:07 AM UTC WinForms 1
loading
Tags: GridControl
Tannearu Hazarathaiah Gupta
Asked On November 30, 2006 09:39 AM UTC

Hi,
I am using Grid Groupping Control. How can I change the row header to display line numbers instead of the black triangle?



Please resolve the problem ASAP.


Regards
Tannearu Gupta

Administrator [Syncfusion]
Replied On November 30, 2006 10:07 AM UTC

Hi Tannearu,

To display the record number on the RowHeader of the grouping grid, you need to handle the QueryCellStyleInfo Event. The code below will help you to accomplish your task. Please refer to the Sample attached for implementation.

this.gridGroupingControl1.TableControl.TableDescriptor.Appearance.RowHeaderCell.CellType = "Header";
this.gridGroupingControl1.TableOptions.RowHeaderWidth = 35;

//Subscribe the QueryCellStyleInfo event.
this.gridGroupingControl1.QueryCellStyleInfo +=new GridTableCellStyleInfoEventHandler(gridGroupingControl1_QueryCellStyleInfo);

private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if( e.Style.CellType == "Header" )
{
Element el = e.TableCellIdentity.DisplayElement;
if( el.Kind == DisplayElementKind.Record)
{
GridRecordRow recRow = el as GridRecordRow;
if( recRow.ParentRecord != null)
{
int iRecordIndex = el.ParentTable.UnsortedRecords.IndexOf(recRow.ParentRecord);
e.Style.Text = (iRecordIndex + 1).ToString() ;
}
}
}
}

Here is a modified sample.
GGCNumberedRowHeader.zip

Best Regards,
Haneef

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

;