This example demonstrates how to create the Excel-style filter drop-down, adjust its settings and modify operators available in the Filter Rules tab. If the PivotGridControl.FieldFilterPopupMode property is set to Excel, all fields have Excel-style filter drop-downs. However, to customize the filter drop-down, you have to use the following approach:
-
Create a custom data template that contains the ExcelStyleFilterElement whose QueryOperators event is handled to modify the list of available operators and add a custom operator.
-
Assign the data template to the PivotGridField.CustomExcelStyleFilterPopupTemplate property.
-
Set the PivotGridField.ImmediateUpdateExcelStyleFilter property to false so that the user should click OK to apply a filter.
The project requires references to the Devexpress.DataAccess, DevExpress.Xpf.Core.Extensions, DevExpress.Xpf.Grid, DevExpress.Xpf.Grid.Core, Devexpress.Xpf.Grid.Extensions assemblies in addition to references created automatically when the PivotGrid control is dropped from VS Designer Toolbox.
- PivotGridField.CustomExcelStyleFilterPopupTemplate property
- ExcelStyleFilterElement class
- QueryOperators event
- PivotGridControl.FieldFilterPopupMode property
- PivotGridControl.ShowOnlyAvailableFilterItems
- PivotGridField.ImmediateUpdateExcelStyleFilter property
- ExcelStyleFilterElementOperatorItem class
- ExcelStyleFilterElementOperatorType enumeration
- TextEditSettings class
- ExcelItemsSource extension
You can use any available filter element in the data template. For the ExcelStyleFilterElement, you can create custom operators or even specify a data editor in an operand template for an operator.
(you will be redirected to DevExpress.com to submit your response)