Skip to main content

DxContextMenu.ShowAsync(MouseEventArgs) Method

Displays the Context Menu according to a mouse event’s coordinates.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor


public Task ShowAsync(
    MouseEventArgs e


Name Type Description
e MouseEventArgs

The Blazor’s built-in MouseEventArgs event arguments.


Type Description

The task that is completed when the context menu is displayed.


Call this method to show the Context Menu at a mouse event’s coordinates (for example, the user’s right-click position). To specify the code that should be executed when the Context Menu is displayed, handle the Shown event.


To display the Context Menu at the specified location (x,y), use the ShowAsync(Double, Double) method. To hide a Context Menu, call the HideAsync() method.

<div style="height: 200px;"  
     @oncontextmenu="((e) => ContextMenu.ShowAsync(e))" 
    <span style="font-weight: 600">RIGHT-CLICK TO SHOW THE CONTEXT MENU</span>

<DxContextMenu @ref="@ContextMenu">
        <DxContextMenuItem Text="Copy" />
        <DxContextMenuItem Text="Cut" />
        <DxContextMenuItem Text="Remove" />

@code {
    DxContextMenu ContextMenu { get; set; }

Run Demo: Context Menu

See Also