Back to Devexpress

PivotGridControl.ShowOnlyAvailableFilterItems Property

wpf-devexpress-dot-xpf-dot-pivotgrid-dot-pivotgridcontrol-cf8acbc6.md

latest3.5 KB
Original Source

PivotGridControl.ShowOnlyAvailableFilterItems Property

Gets or sets whether filter items that cannot be displayed because of filtering applied to other fields should be hidden. This is a dependency property.

Namespace : DevExpress.Xpf.PivotGrid

Assembly : DevExpress.Xpf.PivotGrid.v25.2.dll

NuGet Package : DevExpress.Wpf.PivotGrid

Declaration

csharp
public bool ShowOnlyAvailableFilterItems { get; set; }
vb
Public Property ShowOnlyAvailableFilterItems As Boolean

Property Value

TypeDescription
Boolean

true to hide filter items that cannot be displayed because of filtering applied to other fields; otherwise, false.

|

Remarks

By default, a filter drop-down window invoked for a particular field contains all the unique field values, although some of these values may actually be excluded from the pivot grid by filtering applied to other fields.

Assume that a pivot grid contains two dimension fields: Category Name and Product Name.

If you choose only one product category from the Category Name filter drop-down, all products related to other categories will be excluded from the pivot grid. This means that whether you check or uncheck any of these products in the Product Name filter drop-down, this will have no effect, since they are hidden by the category filtering.

PivotGridControl allows you to remove such field values from filter drop-downs. To do this, set the ShowOnlyAvailableFilterItems property to true.

The image below illustrates the property effect:

You can also obtain a list of available field values in code, using the PivotGridField.GetAvailableValues method.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowOnlyAvailableFilterItems property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-pivotgrid-customize-filter-drop-down/CS/WpfPivotCustomFilterDropDownExample/MainWindow.xaml#L45

xml
FieldFilterPopupMode="Excel"
                   ShowOnlyAvailableFilterItems="True">
<dxpg:PivotGridControl.Fields>

See Also

GetAvailableValues()

PivotGridControl Class

PivotGridControl Members

DevExpress.Xpf.PivotGrid Namespace