New to Telerik UI for WinForms? Start a free 30-day trial
Custom Filtering
Updated on May 7, 2026
Custom filtering is a flexible mechanism for filtering RadTreeView nodes by using custom logic. It has a higher priority than the applied FilterDescriptors.
In order to apply custom logic for filtering, you have to create a Predicate. Here is an example of a Predicate which will return just the nodes which text is longer than one char:
Creating predicate
C#
private bool FilterNode(RadTreeNode node)
{
if (node.Text.Length > 1)
{
return true;
}
return false;
}| Here you have nodes from 1-100 | After the filtering the nodes are only from 10-100, since nodes 1-9 contain just one char as text |
|---|---|
![]() | ![]() |
To set the Predicate to RadTreeView, use the FilterPredicate property of the control:
Applying predicate
C#
radTreeView1.TreeViewElement.FilterPredicate = FilterNode;At the end, in order to apply the filter to the control, just set the Filter property to any string, which will invoke the filtering operation:
Invoke filtering
C#
private void radButton1_Click(object sender, EventArgs e)
{
this.radTreeView1.Filter = "Custom";
}
