New to Telerik UI for WinForms? Start a free 30-day trial
Finding Nodes
Updated over 6 months ago
When searching for node(s) you have several options that you can use
- The Find method which searches for a specific node by text
- A predefined Predicate that returns the first node that matches the search criteria.
- Use the FindNodes method which also provides overloads to search by Text or a Predicate and returns an array of nodes as a result.
The following example demonstrates how to search for a single node by its text and how to get all nodes whose Tag is not null by using a Predicate:
C#
RadTreeNode resultOfSearch = radTreeView1.Find("Child Node");
Predicate<RadTreeNode> match = new Predicate<RadTreeNode>(delegate(RadTreeNode node)
{
return node.Tag != null ? true : false;
});
RadTreeNode[] result = radTreeView1.FindNodes(match);