The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team August 31, 2004 10:53 AM
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
ADAdministrator Syncfusion Team September 26, 2004 08:16 PM
Thanks Matt.
I spent too much time trying to figure the same problem out.
ADAdministrator Syncfusion Team September 27, 2004 12:36 AM
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"