TreeListView.CustomNodeFilter Event

Allows you to use custom rules to filter nodes.

Namespace: DevExpress.Xpf.Grid

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


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.

See Also