Skip to main content
A newer version of this page is available. .

TreeList.FindNode(Predicate<TreeListNode>) Method

Returns the first node that matches the specified criteria.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v19.1.dll

Declaration

public TreeListNode FindNode(
    Predicate<TreeListNode> match
)

Parameters

Name Type Description
match Predicate<TreeListNode>

The method that defines a set of criteria and determines whether a TreeListNode meets those criteria.

Returns

Type Description
TreeListNode

The first node that matches the specified criteria. null (Nothing in Visual Basic) if no matching node is found.

Remarks

The FindNode method calls the specified predicate for each node in the data source until the predicate returns true. When this happens, the currently processed node is returned by the FindNode method.

The following example shows how you can get the first node that has the “London” string in the City column:


TreeListNode myNode = treeList1.FindNode((node) => {
    return node["City"].ToString() == "London";
}
);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FindNode(Predicate<TreeListNode>) method.

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.

See Also