Skip to main content
All docs
V25.1
  • PivotTableFieldFilterMenuDataItem Class

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

    Namespace: DevExpress.Blazor.PivotTable

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

    NuGet Package: DevExpress.Blazor.PivotTable

    Declaration

    public class PivotTableFieldFilterMenuDataItem

    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 Pivot Table - The Filter Menu Button 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 more information, see the following property description: FilterMenuTemplate.

    <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