Back to Devexpress

DxTreeListDataColumn.FilterMenuTemplate Property

blazor-devexpress-dot-blazor-dot-dxtreelistdatacolumn-1d3dacac.md

latest4.0 KB
Original Source

DxTreeListDataColumn.FilterMenuTemplate Property

Specifies a template used to display the column’s filter menu.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public RenderFragment<TreeListDataColumnFilterMenuTemplateContext> FilterMenuTemplate { get; set; }

Property Value

TypeDescription
RenderFragment<TreeListDataColumnFilterMenuTemplateContext>

The template content.

|

Remarks

Use the FilterMenuTemplate property to define a template for the column filter menu.

The template accepts a TreeListDataColumnFilterMenuTemplateContext object as the context parameter. This parameter allows you to do the following:

Note

The GetDataItemsAsync() method cannot obtain unique values from a column whose data items do not implement IComparable type. If you call the method for such a column, an error may occur.

To define a common column filter menu template for all TreeList columns, use the DxTreeList.DataColumnFilterMenuTemplate property.

Run Demo: Column Filter Menu

The following example displays the Start Date filter menu as a ListView:

razor
<DxTreeList Data="Data"
            KeyFieldName="Id"
            ParentKeyFieldName="ParentId"
            FilterMenuButtonDisplayMode="TreeListFilterMenuButtonDisplayMode.Always"
            CustomizeFilterMenu="TreeList_CustomizeFilterMenu"
            CssClass="max-h-480">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" Caption="Assigned To" TextAlignment="TreeListTextAlignment.Left" />
        <DxTreeListDataColumn FieldName="StartDate" Width="150px">
            <FilterMenuTemplate>
                @context.ListView
            </FilterMenuTemplate>
        </DxTreeListDataColumn>
        <DxTreeListDataColumn FieldName="DueDate" Width="150px" />
    </Columns>
</DxTreeList>

For additional information about templates in the TreeList component, refer to the following topic: Templates in Blazor TreeList.

Implements

FilterMenuTemplate

See Also

DxTreeListDataColumn Class

DxTreeListDataColumn Members

DevExpress.Blazor Namespace