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

GridControl column header text

How do I change the header text of a GridControl from the default "A, B, C, ..." to text of my choosing? I looked through every property and collection in the Studio Designer (C#) but could not find where the text is set. I looked through the documentation but was unable to find a function to ''set'' the column header text (found one to ''get'' the text...). Thanks in advance, Matt

3 Replies

AD Administrator Syncfusion Team August 31, 2004 03:53 PM UTC

Never mind - I found the answer in another person''s post of a similar topic. Here''s what I did based on a SyncFusion response: (Note: I have a GridControl with row and col headers enabled and only 1 data column...) string[] headers ={"My New Header"}; int row = 0; int col = 1; foreach(string s in headers) { GridStyleInfo style = new GridStyleInfo(); style.Text = s; this.gridControl1.SetCellInfo(row, col, style, Syncfusion.Styles.StyleModifyType.Override, true, false); col++; } Though I must say that this was not obvious from the documentation for the GridControl class... MattO

AD Administrator Syncfusion Team September 27, 2004 01:16 AM UTC

Thanks Matt. I spent too much time trying to figure the same problem out.

AD Administrator Syncfusion Team September 27, 2004 05:36 AM UTC

Just for others reading this thread, the column headers are row zero. You can set cell specific properties in those cells just like any other cells. So, you can set their text with code like, //CS this.grid[0, someColIndex].Text = "SomeText"; ''VB Me.Grid(0, someColIndex).Text = "SomeText"

Live Chat Icon For mobile
Up arrow icon