Skip to main content
All docs
V24.2

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

BasePopupMenuShowingEventArgs.ShowCustomMenu(IDXDropDownControlEx) Method

Invokes a custom context menu instead of the control’s menu.

Namespace: DevExpress.Utils.Menu

Assembly: DevExpress.Utils.v24.2.dll

NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

#Declaration

public void ShowCustomMenu(
    IDXDropDownControlEx popupMenu
)

#Parameters

Name Type Description
popupMenu DevExpress.Utils.Menu.IDXDropDownControlEx

A custom context menu.

#Remarks

To use the ShowCustomMenu method, you must:

  1. Create a custom context menu (PopupMenu) as demonstrated in the following help topic: Popup Menus.
  2. Pass this menu to the 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:

WinForms - Display Custom Context Menus

void gridView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) {
    if (e.MenuType == GridMenuType.Row)
        e.ShowCustomMenu(popupMenu1);
}

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.

See Also