Back to Devexpress

PivotGridControl.FilterEditorTemplate Property

wpf-devexpress-dot-xpf-dot-pivotgrid-dot-pivotgridcontrol-31649d4c.md

latest3.7 KB
Original Source

PivotGridControl.FilterEditorTemplate Property

Gets or sets a template that defines the presentation of the Filter Element within the Filter Editor dialog. This is a dependency property.

Namespace : DevExpress.Xpf.PivotGrid

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

NuGet Package : DevExpress.Wpf.PivotGrid

Declaration

csharp
public DataTemplate FilterEditorTemplate { get; set; }
vb
Public Property FilterEditorTemplate As DataTemplate

Property Value

TypeDescription
DataTemplate

A DataTemplate object.

|

Example

Use the PivotGridControl.FilterEditorTemplate property to specify a custom data template. You can also use the PivotGridControl.FilterEditorDialogServiceTemplate property to modify the appearance and functionality of the window that hosts the FilterEditorControl. To customize the list of operators, handle the FilterEditorControl.QueryOperators event. The following code demonstrates how to remove all operators except Between and NotBetween :

xaml
<dxpg:PivotGridControl.FilterEditorTemplate>
    <DataTemplate>
        <dxfui:FilterEditorControl QueryOperators="FilterEditorControl_QueryOperators" />
    </DataTemplate>
</dxpg:PivotGridControl.FilterEditorTemplate>
csharp
using DevExpress.Xpf.Core.FilteringUI;
// ... 
private void FilterEditorControl_QueryOperators(object sender, FilterEditorQueryOperatorsEventArgs e)
{
    if (e.FieldName == "fieldOrderDate")
    {
        e.Operators.Clear();
        e.Operators.Add(new FilterEditorOperatorItem(FilterEditorOperatorType.Between) { Caption = "Between" });
        e.Operators.Add(new FilterEditorOperatorItem(FilterEditorOperatorType.NotBetween) { Caption = "NotBetween" });
    }
}
vb
Imports DevExpress.Xpf.Core.FilteringUI
' ...
Private Sub FilterEditorControl_QueryOperators(ByVal sender As Object, ByVal e As FilterEditorQueryOperatorsEventArgs)
    If e.FieldName = "fieldOrderDate" Then
        e.Operators.Clear()
        e.Operators.Add(New FilterEditorOperatorItem(FilterEditorOperatorType.Between) With {.Caption = "Between"})
        e.Operators.Add(New FilterEditorOperatorItem(FilterEditorOperatorType.NotBetween) With {.Caption = "NotBetween"})
        e.Operators.Add(CreateLastYearsOperator())
    End If
End Sub

See Also

Pivot Grid Elements That Support Templates

PivotGridControl Class

PivotGridControl Members

DevExpress.Xpf.PivotGrid Namespace