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

Invalid column headers

Hi,

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?

Regards,
tmn

1 Reply

AD Administrator 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++);

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon