This topic explains how to enable the Microsoft® Excel®-Style Filtering feature of the xamPivotGrid™/ xamPivotDataSelector™ controls.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
When Excel-Style Filtering in the xamPivotGrid control and the data selector is enabled, users can add custom filter conditions for the measure values and for the captions of members from the row and column hierarchies.
By default, Excel-Style Filtering in the xamPivotGrid is not enabled, so you need to explicitly enable it by setting the EnableAdvancedFiltering property to True. This property is available for both the xamPivotGrid and the XamPivotDataSelector.
The following table maps the desired configuration to property settings.
When using Excel-Style Filtering there are a few things you should keep in mind:
In order to enable Excel-Style Filtering, the data source set as the DataSource property of the pivot grid/data selector must implement the ISupportFilters interface. Currently this interface is implemented in the XmlaDataSource.
The default value of EnableAdvancedFiltering is False
.
The EnableAdvancedFiltering
property should be set before any items are added to the columns, rows, filters or measures of the pivot grid or the data selector. This means that if you want to set the property in code (rather than XAML) and there are initial items in columns, rows etc., you should set it before the pivot grid is initialized. For example, a suitable place to set the property in code is the constructor of the Page/UserControl, where the pivot grid or data selector is used. Setting the property should be after InitializeComponent
has been called.(
)
Changing the value of the EnableAdvancedFiltering
property at run-time does not change the existing UI filtering controls in the grid or data selector. However, all hierarchies that are added to the rows, columns, filters, or measures after that will support Excel-Style Filtering or not based on the value that was set to EnableAdvancedFiltering
.