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.
Unfortunately, activation email could not send to your email. Please try again.

Invalid column headers

Thread ID:

Created:

Updated:

Platform:

Replies:

51875 Nov 15,2006 03:24 PM Nov 16,2006 02:15 AM Windows Forms 1
loading
Tags: Grouping
Administrator [Syncfusion]
Asked On November 15, 2006 03:24 PM

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

Administrator [Syncfusion]
Replied On November 16, 2006 02:15 AM

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

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.

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.

;