Back to Devexpress

PivotGridControl.ActiveFilter Property

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotgridcontrol-638ce454.md

latest4.4 KB
Original Source

PivotGridControl.ActiveFilter Property

Provides access to settings of the filter applied to the PivotGridControl‘s data.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.XtraPivotGrid.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
[DXCategory("Data")]
[XtraSerializableProperty(XtraSerializationVisibility.Content, XtraSerializationFlags.DefaultValue)]
[XtraSerializablePropertyId(2)]
public PivotFilter ActiveFilter { get; }
vb
<XtraSerializableProperty(XtraSerializationVisibility.Content, XtraSerializationFlags.DefaultValue)>
<XtraSerializablePropertyId(2)>
<DXCategory("Data")>
Public ReadOnly Property ActiveFilter As PivotFilter

Property Value

TypeDescription
PivotFilter

A PivotFilter object that is a filter applied to data displayed in the PivotGridControl.

|

Remarks

To learn more about filtering, see Filtering Overview.

Note

Filter Panel and Filter Editor display ActiveFilter if the following conditions are met:

Example

The example below shows how to apply complex filter criteria in code using the PivotFilter.Criteria property. This property is exposed by the PivotFilter object that can be accessed using PivotGridControl.ActiveFilter.

csharp
using DevExpress.Data.Filtering;
// ...
            pivotGridControl.ActiveFilter.Criteria = new GroupOperator(GroupOperatorType.And,
                new InOperator(fieldTrademark.PrefilterColumnName, new string[] { "Chevrolet", "Chrysler", "Dodge", "Ford" }),
                new InOperator(fieldBodyStyle.PrefilterColumnName, new string[] { "Coupe" }));
vb
Imports DevExpress.Data.Filtering
' ...
            pivotGridControl.ActiveFilter.Criteria = New GroupOperator(GroupOperatorType.And,
                New InOperator(fieldTrademark.PrefilterColumnName, New String() {"Chevrolet", "Chrysler", "Dodge", "Ford"}),
                New InOperator(fieldBodyStyle.PrefilterColumnName, New String() {"Coupe"}))

See Also

ActiveFilterCriteria

ActiveFilterString

ActiveFilterEnabled

PivotGridControl Class

PivotGridControl Members

DevExpress.XtraPivotGrid Namespace