Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

    DxPivotTable.CustomizeFilterMenu Event

    Allows you to customize filter menu items.

    Namespace: DevExpress.Blazor.PivotTable

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

    NuGet Package: DevExpress.Blazor.PivotTable

    #Declaration

    C#
    [Parameter]
    public Action<PivotTableCustomizeFilterMenuEventArgs> CustomizeFilterMenu { get; set; }

    #Parameters

    Type Description
    PivotTableCustomizeFilterMenuEventArgs

    An object that contains data for this event.

    #Remarks

    The Pivot Table allows you to apply filters to rows, columns, 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. The CustomizeFilterMenu event fires before the Field Filter Menu appears and allows you to customize the list.

    Use the DataItems event argument to access the list of data items 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.

    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

    See Also