DxContextMenu.Show(Double, Double) Method
Displays the Context Menu at the specified location.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v20.2.dll
NuGet Package: DevExpress.Blazor
Declaration
public Task Show(
double x,
double y
)
Parameters
Name | Type | Description |
---|---|---|
x | Double | Specifies the location’s X coordinate. |
y | Double | Specifies the location’s Y coordinate. |
Returns
Type | Description |
---|---|
Task | An asynchronous operation that displays the Context Menu. |
Remarks
Call this method to show the Context Menu at the specified coordinates on a browser window (x,y)
. To specify the code that should be executed when the Context Menu is displayed, handle the Shown event.
Note
To show the Context Menu at a mouse event’s coordinates (for example, the user’s right-click position), use the Show(MouseEventArgs) method. To hide a Context Menu, call the Hide() method.
<div style="height: 200px;"
@oncontextmenu="((e) => ContextMenu.Show(e.ClientX, e.ClientY))"
@oncontextmenu:preventDefault>
<span style="font-weight: 600">RIGHT-CLICK TO SHOW THE CONTEXT MENU</span>
</div>
<DxContextMenu>
<Items>
<DxContextMenuItem Text="Copy"></DxContextMenuItem>
<DxContextMenuItem Text="Cut"></DxContextMenuItem>
<DxContextMenuItem Text="Remove"></DxContextMenuItem>
</Items>
</DxContextMenu>
See Also