Back to Devexpress

PivotTableFieldFilterMenuDataItem Class

blazor-devexpress-dot-blazor-dot-pivottable-a44201e6.md

latest3.1 KB
Original Source

PivotTableFieldFilterMenuDataItem Class

Defines a data item in the Field Filter Menu’s data item collection.

Namespace : DevExpress.Blazor.PivotTable

Assembly : DevExpress.Blazor.PivotTable.v25.2.dll

NuGet Package : DevExpress.Blazor.PivotTable

Declaration

csharp
public class PivotTableFieldFilterMenuDataItem :
    IFilterMenuDataItem

The following members return PivotTableFieldFilterMenuDataItem objects:

Remarks

The Pivot Table allows you to apply filters row, column, and filter fields. For all these fields, the component displays filter menu buttons in field headers. When a user clicks a filter menu button, the Pivot Table creates a list of default filter items to populate the Field Filter Menu.

You can use the CustomizeFilterMenu event to customize the item list. Use the DataItems event argument to access the list of data items (PivotTableFieldFilterMenuDataItem objects) used to generate filter menu items. Each data item contains a unique value and the corresponding displayed text. Note that data items that have a null or empty value are combined into a single filter menu item labeled Blanks.

You can customize, add, or remove items. Note that items cannot store filter criteria as values. To implement complex filter criteria, create a filter menu template. For additional information, see the following property description: FilterMenuTemplate.

razor
<DxPivotTable @ref="@PivotTable"
              Data="@PivotData"
              CustomizeFilterMenu="@OnCustomizeFilterMenu">
    <Fields>
    @*...*@
    </Fields>
</DxPivotTable>

@code {
    IPivotTable PivotTable { get; set;}

    //...

    void OnCustomizeFilterMenu(PivotTableCustomizeFilterMenuEventArgs args) {
        if(string.Equals(args.Field.Field, nameof(VehiclesData.TrademarkItem.BodyStyle))) {
            foreach(var item in args.DataItems)
                item.Text = Enum.GetName<BodyStyle>((BodyStyle)item.Value);
        }
    }
}

Run Demo: Field Filter Menu

Inheritance

Object PivotTableFieldFilterMenuDataItem

See Also

PivotTableFieldFilterMenuDataItem Members

DevExpress.Blazor.PivotTable Namespace