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.
I'm binding the control to a data table but column headers get their names from the data table's column names (DataColumn.ColumnName) instead of the DataColumn.Caption property (as I expect and as it appears in the standard .NET DataGridView control)
1. How can I make column headers get their names from the column captions? 2. How can I change the captions at runtime?
ADAdministrator Syncfusion Team November 16, 2006 07:15 AM UTC
Hi Tmn,
1) How can I make column headers get their names from the column captions?
By Default, GroupingGrid displays the ColumnHeader text from the caption property of the DataColumn in the DataTable. Please refer to the attached sample for more details and let me know if you are looking something different
Here is a sample. http://www.syncfusion.com/Support/user/uploads/GGC_ColumnHeader_50d31221.zip
2 ) How can I change the captions at runtime?
You can change the captiontext/HeaderText of the column by using the GridColumnDescriptor.HeaderText property. Here is a code snippet.
int i = 0; foreach(GridColumnDescriptor column in this.gridGroupingControl1.TableDescriptor.Columns) column.HeaderText = "HeaderText" + (i++);