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

Custom Header

2 Answers 106 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Keith
Top achievements
Rank 1
Keith asked on 25 Mar 2011, 10:04 PM
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 Answers, 1 is accepted

Sort by
0
Keith
Top achievements
Rank 1
answered on 30 Mar 2011, 08:49 PM
Can i get an answer or response.
0
Tsvetina
Telerik team
answered on 31 Mar 2011, 08:35 AM
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
Tags
TreeList
Asked by
Keith
Top achievements
Rank 1
Answers by
Keith
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or