Skip to main content

TreeList.FindNode(Predicate<TreeListNode>) Method

Returns the first node that matches the specified criteria.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v24.2.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";
}
);
See Also