Skip to main content

DxTreeView.SelectNode(Func<ITreeViewNodeInfo, Boolean>) Method

Selects the specified node.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.1.dll


public void SelectNode(
    Func<ITreeViewNodeInfo, bool> predicate


Name Type Description
predicate Func<ITreeViewNodeInfo, Boolean>

A method delegate that specifies a particular node.


When the AllowSelectNodes property is set to true, the DxTreeView component allows selecting its nodes.

Use the SelectNode method to select a node programmatically.

<button type="button" @onclick="@(() => SelectNode("Lanthanides"))">Select Lanthanides</button>

<DxTreeView @ref="@SampleTreeView" AllowSelectNodes="true">
        <DxTreeViewNode Text="Metals">
                <DxTreeViewNode Text="Alkali metals" />
                <DxTreeViewNode Text="Alkaline earth metals" />
                <DxTreeViewNode Text="Inner transition elements">
                        <DxTreeViewNode Text="Lanthanides" />
                        <DxTreeViewNode Text="Actinides" />
                <DxTreeViewNode Text="Transition elements" />
                <DxTreeViewNode Text="Other metals" />
        <DxTreeViewNode Text="Metalloids" />
        <DxTreeViewNode Text="Nonmetals" />

@code  {
    DxTreeView SampleTreeView;

    void SelectNode(string text) {
        SampleTreeView.SelectNode((n) => n.Text == text);
        SampleTreeView.ExpandToNode((n) => n.Text == text);


This method does not select the specified node if Load Child Nodes on Demand mode is enabled, and the node is not loaded yet.

See Also