Custom Header

3 posts, 0 answers
  1. Keith
    Keith avatar
    3 posts
    Member since:
    Jan 2011

    Posted 25 Mar 2011 Link to this post

    I would like to remove the "Select All" checkbox from the header, and add an expand all button to the header above the "+" icons.  What is the best way to do this?  There doesn't seem to be a "header template" for this control.

  2. Keith
    Keith avatar
    3 posts
    Member since:
    Jan 2011

    Posted 30 Mar 2011 Link to this post

    Can i get an answer or response.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 31 Mar 2011 Link to this post

    Hello Keith,

    You can hide the SelecAll check box in the select column by using the following code:
    protected void RadTreeList1_ItemCreated(object sender, TreeListItemCreatedEventArgs e)
    {
        if (e.Item is TreeListHeaderItem)
        {
            (e.Item as TreeListHeaderItem)["SelectColumn"].Controls[0].Visible = false;
        }
    }

    As for expand/collapse, the buttons are not placed in a separate column, they are just part of the first cell in every row. Therefore, they do not have a separate cell in the header. Therefore, you can consider adding a button outside of the treelist for example and use it to expand all items.

    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="ExpandAll" />

    protected void Button1_Click(object sender, EventArgs e)
     {
         RadTreeList1.ExpandAllItems();
     }


    Best wishes,
    Tsvetina
    the Telerik team
Back to Top