Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TreeList.FindNode(Predicate<TreeListNode>) Method

Returns the first node that matches the specified criteria.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v24.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList

#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