Dynamic Column Header Style

3 posts, 1 answers
  1. Gabriel
    Gabriel avatar
    18 posts
    Member since:
    Jun 2011

    Posted 21 Oct 2011 Link to this post

    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. Answer
    Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 24 Oct 2011 Link to this post

    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 >>

  3. Gabriel
    Gabriel avatar
    18 posts
    Member since:
    Jun 2011

    Posted 24 Oct 2011 Link to this post

    Thanks Vanya!

    This is just plain simple, I was trying to mess around with styles and templates... my bad!
Back to Top