This is a migrated thread and some comments may be shown as answers.

Remove underscores in column headers

1 Answer 65 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 10 Jun 2010, 10:22 PM
Hi:

I am displaying views from SQL Server constructed by someone else.  He has aliased the column names to English language names that can be understood by the end user.  However, the spaces in the names are being replaced by underscores.  So for instance, "Patient Admission Date" becomes "Patient_Admission_Date".  Is this something that WCF RIA services is doing or is the grid doing it?

Any idea how to make things work the way I want?

Thanks,

Terry

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 15 Jun 2010, 01:33 PM
Hello Terry,

You can subscribe to the AutoGeneratingColumn event of the gridview and replace the _ with a space:

private void gridView_AutoGeneratingColumn(object sender, GridViewAutoGeneratingColumnEventArgs e)
{
    e.Column.Header = ((string) e.Column.Header).Replace("_", " ");
}

Hope this helps.

Kind regards,
Veskoni
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Terry
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or