Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TreeListView.SubstituteFilter Event

Allows you to replace the applied filter with another filter.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public event EventHandler<SubstituteFilterEventArgs> SubstituteFilter

#Event Data

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

Property Description
Filter Gets 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.

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'");
    }
}

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