Skip to main content

TreeListView.CustomNodeFilter Event

Allows you to use custom rules to filter nodes.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core


public event TreeListNodeFilterEventHandler CustomNodeFilter

Event Data

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

Property Description
Handled Gets or sets whether custom filtering is handled and no default processing is required.
Node Gets the processed node.
Visible Gets or sets the processed node’s visibility.

The event data class exposes the following methods:

Method Description
CalcVisibility() Returns the node’s visibility state based on the currently applied filter.


Use the CustomNodeFilter event to apply a custom filter condition. The custom filter takes priority over the filter criteria applied in a column’s Drop-down Filter or the Automatic Filter Row.

To apply a custom filter condition, handle the CustomNodeFilter event. The GridControl raises this event for each node. The e.Node property returns the processed node, and the e.CalcVisibility() method returns the node’s visibility state based on the applied filter.

To hide or show a node, specify the e.Visible property, and set the e.Handled property to true.

If the e.Handled property is set to false, the filter applied to the GridControl determines the row’s visibility.


If you set the TreeListView.FilteringMode property to TreeListFilteringMode.Recursive and hide a node, the GridControl hides all its child nodes regardless of their visibility.

If you want to maintain a clean MVVM pattern and specify custom filter rules in a View Model, create a command and bind it to the CustomNodeFilterCommand property.

Refer to the following help topic for more information: Filtering and Searching.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomNodeFilter event.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also