Turn off RadTreeList header

3 posts, 1 answers
  1. Paul Davies
    Paul Davies avatar
    8 posts
    Member since:
    Aug 2004

    Posted 20 Mar 2011 Link to this post

    Hello,

    Is it possible to turn off the RadTreeList header either via CSS or through code-behind?

    Thanks in advance!
  2. Answer
    Veli
    Admin
    Veli avatar
    2002 posts

    Posted 21 Mar 2011 Link to this post

    Hello Paul,

    You can hide the treelist header in a couple of ways:

    1. Use CSS:

    .rtlHeader
    {
        display:none;
    }

    2. Use RadTreeList's ItemCreated event to hide it on the server with Style["display"] = "false" (same as using CSS):

    protected void RadGri1_ItemCreated(object sender, TreeListItemCreatedEventArgs e)
    {
        if (e.Item is TreeListHeaderItem)
        {
            e.Item.Style["display"] = "none";
        }
    }

    3. Use RadTreeList's ItemCreated event to hide it on the server with Visible=false (header won't be rendered at all):

    protected void RadGri1_ItemCreated(object sender, TreeListItemCreatedEventArgs e)
    {
        if (e.Item is TreeListHeaderItem)
        {
            e.Item.Visible = false;
        }
    }

    Veli
    the Telerik team
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul Davies
    Paul Davies avatar
    8 posts
    Member since:
    Aug 2004

    Posted 21 Mar 2011 Link to this post

    Thanks, worked perfectly.

    Cheers,

    Paul
Back to Top