windowsforms-devexpress-dot-utils-dot-menu-dot-basepopupmenushowingeventargs-dot-showcustommenu-x28-devexpress-dot-utils-dot-menu-dot-idxdropdowncontrolex-x29.md
Invokes a custom context menu instead of the control’s menu.
Namespace : DevExpress.Utils.Menu
Assembly : DevExpress.Utils.v25.2.dll
NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core
public void ShowCustomMenu(
IDXDropDownControlEx popupMenu
)
Public Sub ShowCustomMenu(
popupMenu As IDXDropDownControlEx
)
| Name | Type | Description |
|---|---|---|
| popupMenu | DevExpress.Utils.Menu.IDXDropDownControlEx |
A custom context menu.
|
To use the ShowCustomMenu method, you must:
ShowCustomMenu method as a parameter.The code sample below uses the ShowCustomMenu method to invoke a custom context menu when a user right-clicks a grid row:
void gridView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) {
if (e.MenuType == GridMenuType.Row)
e.ShowCustomMenu(popupMenu1);
}
Private Sub gridView1_PopupMenuShowing(ByVal sender As Object, ByVal e As PopupMenuShowingEventArgs)
If e.MenuType = GridMenuType.Row Then e.ShowCustomMenu(popupMenu1)
End Sub
Common concepts for custom context menus are listed in the following help topic: Custom Context Menus.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowCustomMenu(IDXDropDownControlEx) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-grid-show-context-menu-for-rows/CS/FormGridMenu.cs#L18
popupMenu_Row.Tag = e.HitInfo;
e.ShowCustomMenu(popupMenu_Row);
}
winforms-grid-show-context-menu-for-rows/VB/FormGridMenu.vb#L19
popupMenu_Row.Tag = e.HitInfo
e.ShowCustomMenu(popupMenu_Row)
End If
See Also
BasePopupMenuShowingEventArgs Class