TreeListView.CustomNodeFilter Event
Enables you to filter nodes using custom rules.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v20.2.dll
NuGet Packages: DevExpress.WindowsDesktop.Wpf.Grid.Core, DevExpress.Wpf.Grid.Core
Declaration
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 |
---|
CalcVisibility() |
Remarks
Custom filtering is hiding individual nodes, or making them visible. Custom filtering takes priority over filter criteria applied using a column’s filter dropdown or using the Automatic Filter Row.
To manually filter nodes, handle the CustomNodeFilter event. This event is raised for each node. The currently processed node is returned by the event parameter’s TreeListNodeFilterEventArgs.Node property.
To hide or show a node, specify the event parameter’s TreeListNodeFilterEventArgs.Visible property, and set the TreeListNodeFilterEventArgs.Handled property to true. If the TreeListNodeFilterEventArgs.Handled parameter is set to false, the node’s visibility is determined by the filter currently applied to a View. So, the node will only be visible if it matches the View’s filter. Otherwise, it will be hidden.
Note
If a node is hidden and the TreeListView.FilterMode property is set to TreeListFilterMode.Standard, all its child nodes are also hidden regardless of their visibility.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomNodeFilter event.
Note
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.