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

DxTreeViewNode.Click Event

Fires when a user clicks the TreeView node.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public EventCallback<TreeViewNodeClickEventArgs> Click { get; set; }

#Event Data

The Click event's data class is TreeViewNodeClickEventArgs. The following properties provide information specific to this event:

Property Description
MouseEventArgs The Blazor’s built-in MouseEventArgs event arguments.
NodeInfo Returns information about a node related to the event.

#Remarks

Use the DxTreeViewNode.Click event to react to click on a specific item. The following code snippet handles the Click event:

razor
<DxTreeView>
  <Nodes>
    <DxTreeViewNode Click=@OnClick Text="Form Layout" />
    <DxTreeViewNode Text="TreeView" />
    <DxTreeViewNode Text="Tabs" />
  </Nodes>
</DxTreeView>

@Message

@code {
    string Message { get; set; }
    void OnClick(TreeViewNodeClickEventArgs args) {
        var Node = args.NodeInfo;
        Message = Node.Text + " was clicked.";
    }
}

Single Node Click

If you want to have one event handler for all items, use the DxTreeView.NodeClick event.

See Also