Skip to main content

DxContextMenuItem.Click Event

Fires when a user clicks the processed menu item.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public EventCallback<ContextMenuItemClickEventArgs> Click { get; set; }

Event Data

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

Property Description
ItemInfo Returns information about a clicked menu item.

Remarks

Handle the Click event to specify individual click handlers for unbound menu items. You can also use the ItemClick event to specify a common click handler that is applied to all menu items.

<DxContextMenu>
    <Items>
        <DxContextMenuItem Text="Font" Click=@OnItemClick /> 
        <DxContextMenuItem Text="Size" />
        <DxContextMenuItem Text="Style" />
        <DxContextMenuItem Text="Clear Formatting" BeginGroup="true" />
    </Items>
</DxContextMenu>

@code {
    void OnItemClick() {
      // Your code
    }
}

Run Demo: Context Menu

See Also