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
close icon

Display row numbers in GDBG

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

3 Replies

AD Administrator Syncfusion Team 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


AD Administrator Syncfusion Team 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


TL Thomas Lother January 8, 2006 02:13 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon