Skip to main content
All docs
V25.1
  • BasePopupMenuShowingEventArgs.ShowCustomMenu(IDXDropDownControlEx) Method

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

    Namespace: DevExpress.Utils.Menu

    Assembly: DevExpress.Utils.v25.1.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