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

DxContextMenuItem.Click Event

Fires when a user clicks the processed menu item.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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.

Razor
<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