ContextMenu Support on RadzenMenuItem #1024

Closed
opened 2026-01-29 17:47:57 +00:00 by claunia · 0 comments
Owner

Originally created by @gauss-lvs-dev on GitHub (Oct 30, 2023).

Is your feature request related to a problem? Please describe.
Right now it is not possible to open a context menu on RadzenMenuItem. Although RadzenMenuItem has a ContextMenu property.

Describe the solution you'd like
If I perform a right-click on a RadzenMenuItem I'd like to see a context menu appear.

Describe alternatives you've considered
As a workaround I used RadzenButtons for the toolbar. Unfortunately it is then rather complicated to create submenu items.

Additional context

RadzenMenu initialization:

<RadzenMenu>
  <RadzenMenuItem Text="General" Icon="home">
  @foreach (var item in NavFav)
  {
    <RadzenMenuItem Text="@item.Title" Image="@item.GetDarkImage()" Path="@item.Path"
                    ContextMenu="@(args => toolbarContextMenuInit?.InitContextMenu(args, item))" />
  }
  </RadzenMenuItem>
</RadzenMenu>

radzenmenuitem-no-contextmenu

Custom/Workaround solution:

<div class="my-toolbar favorites">
   @foreach (var item in NavFav)
   {
     <RadzenButton class="my-toolbar-icon" ButtonStyle="@ButtonStyle.Light" Image="@item.GetDarkImage()"
                              Click="@(() => NavigationManager.NavigateTo(item.Path ?? ""))"
                              ContextMenu="@(args => toolbarContextMenuInit?.InitContextMenu(args, item))" />
   }
</div>

radzenbutton-working-contextmenu

Working context menu with RadzenPanelMenuItem:
radzenpanelmenuitem-working-contextmenu

Originally created by @gauss-lvs-dev on GitHub (Oct 30, 2023). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can request your feature via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. --> **Is your feature request related to a problem? Please describe.** Right now it is not possible to open a context menu on RadzenMenuItem. Although RadzenMenuItem has a ContextMenu property. **Describe the solution you'd like** If I perform a right-click on a RadzenMenuItem I'd like to see a context menu appear. **Describe alternatives you've considered** As a workaround I used RadzenButtons for the toolbar. Unfortunately it is then rather complicated to create submenu items. **Additional context** RadzenMenu initialization: ``` <RadzenMenu> <RadzenMenuItem Text="General" Icon="home"> @foreach (var item in NavFav) { <RadzenMenuItem Text="@item.Title" Image="@item.GetDarkImage()" Path="@item.Path" ContextMenu="@(args => toolbarContextMenuInit?.InitContextMenu(args, item))" /> } </RadzenMenuItem> </RadzenMenu> ``` ![radzenmenuitem-no-contextmenu](https://github.com/radzenhq/radzen-blazor/assets/51820531/d520ad5a-2a5b-4326-9152-6e6bb113b024) Custom/Workaround solution: ``` <div class="my-toolbar favorites"> @foreach (var item in NavFav) { <RadzenButton class="my-toolbar-icon" ButtonStyle="@ButtonStyle.Light" Image="@item.GetDarkImage()" Click="@(() => NavigationManager.NavigateTo(item.Path ?? ""))" ContextMenu="@(args => toolbarContextMenuInit?.InitContextMenu(args, item))" /> } </div> ``` ![radzenbutton-working-contextmenu](https://github.com/radzenhq/radzen-blazor/assets/51820531/c13b014f-b3e4-45ed-a98f-e61de7a28bde) Working context menu with RadzenPanelMenuItem: ![radzenpanelmenuitem-working-contextmenu](https://github.com/radzenhq/radzen-blazor/assets/51820531/81a0f1de-1752-43ca-8a5d-325e46608b4b)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1024