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

Change Column Header Text in Code Behind

2 Answers 119 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Daniel Neto
Top achievements
Rank 1
Daniel Neto asked on 24 Jun 2010, 12:30 PM
Hi there,

I need to change a column header text after the grid has been loaded.
I've tryed to put a text block in the header and change it in the code behind, but i get an error.
Is there any simple way to acomplish this?

Thanks,
Daniel.

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 24 Jun 2010, 12:40 PM
Hello Daniel,

 I'm not sure about this exception at your end however I've just tried this and everything worked fine no matter if you set simple string or UI element like TextBlock. You can check an example application attached.

Kind regards,
Vlad
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
0
Daniel Neto
Top achievements
Rank 1
answered on 24 Jun 2010, 02:38 PM
Thanks Vlad,

The example helped me solve the problem. I think my issue was due to the fact that the textblock was being created, and added to the column header, in XAML and not in code behind as your example.

Cheers,
Daniel.
Tags
GridView
Asked by
Daniel Neto
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Daniel Neto
Top achievements
Rank 1
Share this question
or