Skip to main content

TreeListCommandColumnClearFilterButton Class

A command button that clears the filter applied to the ASPxTreeList.

Namespace: DevExpress.Web.ASPxTreeList

Assembly: DevExpress.Web.ASPxTreeList.v22.1.dll

Declaration

public class TreeListCommandColumnClearFilterButton :
    TreeListCommandColumnButton

The following members return TreeListCommandColumnClearFilterButton objects:

Remarks

The ClearFilter command button allows users to clear filter row values.

ClearFilter Button

In markup:

<dx:ASPxTreeList ID="TreeList" runat="server"...>
    <Columns>
        <!--...-->   
        <dx:TreeListCommandColumn>
            <ClearFilterButton Visible="true" />
        </dx:TreeListCommandColumn>
    </Columns>
    <Settings ShowFilterRow="true" />
    <SettingsBehavior FilterRowMode="OnClick"/>
    <!--...-->
</dx:ASPxTreeList>

In code:

protected void Page_Init(object sender, EventArgs e)
{
    ASPxTreeList treeList = new ASPxTreeList();
    treeList.ID = "treeList";
    Form.Controls.Add(treeList);

    treeList.Settings.ShowFilterRow = true;
    treeList.SettingsBehavior.FilterRowMode = DevExpress.Web.GridViewFilterRowMode.OnClick;

    TreeListDataColumn col = new TreeListDataColumn();
    col.FieldName = "Column_name";
    treeList.Columns.Add(col);
    //...
    DataTable table = new DataTable();
    table.Columns.Add("Column_name", typeof(string));
    table.Rows.Add("Value");
    //...
    treeList.DataSource = table;
    treeList.DataBind();

    TreeListCommandColumn commandColumn = new TreeListCommandColumn();
    commandColumn.ClearFilterButton.Visible = true;
    treeList.Columns.Add(commandColumn);
}

MVC:

@Html.DevExpress().TreeList(settings => {
    settings.Name = "treeList";
    settings.Settings.ShowFilterRow = true;
    settings.SettingsBehavior.FilterRowMode = GridViewFilterRowMode.OnClick;
    //...
    settings.CommandColumn.Visible = true;
    settings.CommandColumn.ClearFilterButton.Visible = true;
}).Bind(Model).GetHtml()

Implements

Inheritance

See Also