Back to Devexpress

PivotGridField.FieldFilterValues Property

wpf-devexpress-dot-xpf-dot-pivotgrid-dot-pivotgridfield-f06c1cc6.md

latest2.7 KB
Original Source

PivotGridField.FieldFilterValues Property

Gets or sets the filter values for the current field.

Namespace : DevExpress.Xpf.PivotGrid

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

NuGet Package : DevExpress.Wpf.PivotGrid

Declaration

csharp
public IEnumerable FieldFilterValues { get; set; }
vb
Public Property FieldFilterValues As IEnumerable

Property Value

TypeDescription
IEnumerable

An object that implements the IEnumerable interface and represents a collection of field filter values.

|

Remarks

The following example shows how to how to filter in markup the Category field by the “Produce” and “Seafood” values. To do this, add these values to the FieldFilterValues collection and set a filter type using the PivotGridField.FilterType property.

xaml
<dxpg:PivotGridField Area="RowArea" Caption="Category" FieldName="CategoryName" 
                     Name="fieldCategory" AreaIndex="0" FilterType="Included">
    <dxpg:PivotGridField.FieldFilterValues>
        <x:Array Type="{x:Type sys:String}" xmlns:sys="clr-namespace:System;assembly=mscorlib">
            <sys:String>Produce</sys:String>
            <sys:String>Seafood</sys:String>
        </x:Array>
    </dxpg:PivotGridField.FieldFilterValues>
</dxpg:PivotGridField>

The code sample below illustrates how to define the same filter values in code-behind:

csharp
public MainWindow() {
    List<object> filterValues = new List<object>();
    filterValues.Add("Produce");
    filterValues.Add("Seafood");

    fieldCategory.FilterType = DevExpress.Xpf.PivotGrid.FieldFilterType.Included;
    fieldCategory.FieldFilterValues = filterValues;
}
vb
Public Sub New()
    Dim filterValues As New List(Of Object)()
    filterValues.Add("Produce")
    filterValues.Add("Seafood")

    fieldCategory.FilterType = DevExpress.Xpf.PivotGrid.FieldFilterType.Included
    fieldCategory.FieldFilterValues = filterValues
End Sub

See Also

PivotGridField Class

PivotGridField Members

DevExpress.Xpf.PivotGrid Namespace