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

[Solved] Dynamic Column Header Style

2 Answers 169 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gabriel
Top achievements
Rank 1
Gabriel asked on 21 Oct 2011, 03:58 PM
Hello,

I load my columns + data dynamically and depending of the type of data in columns I want to have an image as the header. Look at the attached image to see that the paperclip is a column header (attachments in SharePoint).

How can I dynamically change the Column Header template?

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 24 Oct 2011, 07:00 AM
Hello Gabriel,

 
The Header property of each column is of type object and once you have access to the corresponding column you may set directly its Header property, something like the following:

TextBlock tb = new TextBlock();
 tb.Text = "Custom Header";
 this.radGridView1.Columns[0].Header = tb;



Regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Gabriel
Top achievements
Rank 1
answered on 24 Oct 2011, 02:34 PM
Thanks Vanya!

This is just plain simple, I was trying to mess around with styles and templates... my bad!
Tags
GridView
Asked by
Gabriel
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Gabriel
Top achievements
Rank 1
Share this question
or