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.

Display row numbers in GDBG

Thread ID:

Created:

Updated:

Platform:

Replies:

39361 Jan 5,2006 05:18 AM Jan 8,2006 09:13 AM Windows Forms 3
loading
Tags: GridControl
Thomas Lother
Asked On January 5, 2006 05:18 AM

Hi, I want to display the row number in the row header of a GDBG. The normal GridControl does this by default. I already tried to set the Text in the QueryCellInfo-event but it dit not work. Any ideas? Thanx Tom

Administrator [Syncfusion]
Replied On January 5, 2006 06:32 AM

Hi Tom, To have numbered row headers in GridDataBoundGrid, you need to handle the PrepareViewStyleInfo Event. The code below will help you to accomplish your task. Please refer to the Sample attached for this. // Form load this.gridDataBoundGrid1.Model.BaseStylesMap["Row Header"].StyleInfo.CellType = "Header"; //PrepareViewStyleInfo Event private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e) { e.Style.Enabled = true; e.Style.Text = string.Format("{0}",e.RowIndex); e.Style.Font.Bold = false; } Thanks, Rajagopal

RowHeaders.zip

Administrator [Syncfusion]
Replied On January 5, 2006 06:44 AM

Hi Tom, To have numbered row headers in GridDataBoundGrid, you need to handle the PrepareViewStyleInfo Event. The code below will help you to accomplish your task. Please refer to the Sample attached for this. // Form load this.gridDataBoundGrid1.Model.BaseStylesMap["Row Header"].StyleInfo.CellType = "Header"; //PrepareViewStyleInfo Event private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e) { e.Style.Enabled = true; e.Style.Text = string.Format("{0}",e.RowIndex); e.Style.Font.Bold = false; } Thanks, Rajagopal

RowHeaders0.zip

Thomas Lother
Replied On January 8, 2006 09:13 AM

Hi Rajagopal, I tried your example - and it works. Thank you for your help. Tom

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.

;