Change Headertext programmatically

4 posts, 1 answers
  1. Viktor Takacs
    Viktor Takacs avatar
    95 posts
    Member since:
    Mar 2006

    Posted 11 Jul 2011 Link to this post

    HI,
    I am trying to set the HeaderText property of the columns in a RadTreeList, however, it doesn't seem to respond to the following command:
    tlCategories.Columns[0].HeaderText = common.RM.GetString("ctName");

    The column's header stays empty.
    If I use the HeaderText attribute in the aspx file it displays it correctly.

    I am back to a previous issue I encountered with a GridView. Are these related? Any way around it?

    By the way: the localization example on your deom site doesn't work at all: it fails to display localized resources and when I click on the related files link it gives me a no access error...

    Any pointers would be greatly appreciated!
  2. Viktor Takacs
    Viktor Takacs avatar
    95 posts
    Member since:
    Mar 2006

    Posted 11 Jul 2011 Link to this post

    HI,

    I think I spoke a bit too fast... sorry about that....
    It does display something in the header, but according to the Culture. So the same issue happens as with the DataGrid.
    thanks
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 14 Jul 2011 Link to this post

    Hi Viktor,

    The best way to access a column in RadTreeList is to use its UniqueName:
    tlCategories.Columns["Column_UniqueName_here"].HeaderText = common.RM.GetString("ctName");

    For more information, you can check the below articles:
    http://www.telerik.com/help/aspnet-ajax/treelist-column-types.html
    http://www.telerik.com/help/aspnet-ajax/treelist-accessing-items.html

    Regarding the mentioned demo: can you check it now and let me know if you find any issues? The broken link should be already fixed.

    Kind regards,
    Iana
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  5. Viktor Takacs
    Viktor Takacs avatar
    95 posts
    Member since:
    Mar 2006

    Posted 14 Jul 2011 Link to this post

    Hi Iana,

    yes, that was it - they all seem to work now.thanks again for the quick reply!

    viktor
Back to Top