Skip to main content

DxTreeViewNode.Click Event

Fires when a user clicks the TreeView node.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[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 example below shows how to handle the Click event:

<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