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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridControl column header text

Thread ID:

Created:

Updated:

Platform:

Replies:

18450 Aug 31,2004 03:42 PM UTC Sep 27,2004 05:36 AM UTC WinForms 3
loading
Tags: GridControl
MattO
Asked On August 31, 2004 03:42 PM UTC

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

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On September 27, 2004 01:16 AM UTC

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

Administrator [Syncfusion]
Replied On 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"

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

;