At the moment the filter predicate is called only for the root nodes. A possible workaround is to recursively apply the filter logic for the child nodes as well.
Workaround:
private void Button1_Click(object sender, EventArgs e)
{
this.radTreeView1.TreeViewElement.FilterPredicate = this.FilterNode;
this.radTreeView1.Filter = "Custom";
}
private bool FilterNode(RadTreeNode node)
{
Console.WriteLine(node.Text);
if (node.Text.Contains("Child: 3"))
{
return true;
}
Stack<RadTreeNode> children = new Stack<RadTreeNode>();
if (node.Nodes.Count > 0)
{
children.Push(node);
while (children.Count > 0)
{
RadTreeNode current = children.Pop();
foreach (RadTreeNode child in current.Nodes)
{
if (child.Text.Contains("Child: 3"))
{
return true;
}
children.Push(child);
}
}
}
return false;
}