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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Display row numbers in GDBG

Thread ID:

Created:

Updated:

Platform:

Replies:

39361 Jan 5,2006 10:18 AM UTC Jan 8,2006 02:13 PM UTC WinForms 3
loading
Tags: GridControl
Thomas Lother
Asked On January 5, 2006 10:18 AM UTC

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 11:32 AM UTC

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 11:44 AM UTC

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 02:13 PM UTC

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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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

;