Back to Devexpress

TreeListView.SubstituteFilter Event

wpf-devexpress-dot-xpf-dot-grid-dot-treelistview-8cf850cb.md

latest2.5 KB
Original Source

TreeListView.SubstituteFilter Event

Allows you to replace the applied filter with another filter.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public event EventHandler<SubstituteFilterEventArgs> SubstituteFilter
vb
Public Event SubstituteFilter As EventHandler(Of SubstituteFilterEventArgs)

Event Data

The SubstituteFilter event's data class is SubstituteFilterEventArgs. The following properties provide information specific to this event:

PropertyDescription
FilterGets or sets the filter applied to a data control.

Remarks

The currently applied filter is specified by the Filter event parameter. To replace this filter, assign a new filter criterion to this parameter.

csharp
private void treeList1_SubstituteFilter(object sender, DevExpress.Data.SubstituteFilterEventArgs e){  
    if (e.Filter.ToString() == "[DEPARTMENT] = 'Corporate Headquarters'"){
        e.Filter = DevExpress.Data.Filtering.CriteriaOperator.Parse("[DEPARTMENT] = 'Corporate Headquarters' And [LOCATION] = 'Monterey'");
    }
}
vb
Private Sub treeList1_SubstituteFilter(sender As Object, e As DevExpress.Data.SubstituteFilterEventArgs)
    If e.Filter.ToString() = "[DEPARTMENT] = 'Corporate Headquarters'" Then
        e.Filter = DevExpress.Data.Filtering.CriteriaOperator.Parse("[DEPARTMENT] = 'Corporate Headquarters' And [LOCATION] = 'Monterey'")
    End If
End Sub

Do not modify the existing filter object assigned to the Filter event parameter.

Refer to the following help topic for more information on criteria patchers: Traverse Through and Modify the CriteriaOperator Instances.

See Also

TreeListView Class

TreeListView Members

DevExpress.Xpf.Grid Namespace