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
[Parameter]
public Action<PivotTableCustomizeFilterMenuEventArgs> CustomizeFilterMenu { get; set; }
#Parameters
Type | Description |
---|---|
Pivot |
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 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.
<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);
}
}
}