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.v22.1.dll


public Task ShowAsync(
    MouseEventArgs e


Name Type Description
e MouseEventArgs

The Blazor’s built-in MouseEventArgs event arguments.


Type Description

An asynchronous operation that displays the Context Menu.


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