Duplicated
Last Updated: 19 Sep 2021 14:53 by ADMIN
Created by: Christopher
Comments: 1
Category: ContextMenu
Type: Feature Request
10

When using Template there's no way to trigger a close of the ContextMenu when clicking inside the template. 

---

ADMIN EDIT 

Marked as duplicated, because the feature will be implemented in ContextMenu and Menu component at once. For better tracking, we will keep the item logged for the Menu component.

Sample workaround:

@inject IJSRuntime _js

<script suppress-error="BL9992">
    function hideMenu(menuClass) {
        setTimeout(function () {
            var menuParent = document.querySelector("." + menuClass);
            if (menuParent) {
                menuParent.dispatchEvent(new KeyboardEvent('keydown', { 'key': 'Escape' }));
            }
        }, 50);
    }
</script>

<div class="menuTarget">
    right click this target
</div>

<style>
    .menuTarget {
        width: 100px;
        background: yellow;
        margin: 50px;
    }
</style>

<TelerikContextMenu Data="@MenuItems" @ref="@TheContextMenu" Selector=".menuTarget" Class="@menuClass">
    <Template>

        <TelerikButton OnClick="@HideMenu">Hide Menu</TelerikButton>

    </Template>
</TelerikContextMenu>

@code {
    string menuClass = "my-context-menu";
    async Task HideMenu()
    {
        await _js.InvokeVoidAsync("hideMenu", menuClass);
    }

    // sample data binding

    public List<ContextMenuItem> MenuItems { get; set; }
    TelerikContextMenu<ContextMenuItem> TheContextMenu { get; set; }
    bool UseSpecialMenu { get; set; }

    async Task ShowContextMenu(MouseEventArgs e)
    {
        await TheContextMenu.ShowAsync(e.ClientX, e.ClientY);
    }

    // generate sample data for the listview and the menu
    protected override void OnInitialized()
    {
        MenuItems = new List<ContextMenuItem>()
    {
        new ContextMenuItem
        {
            Text = "More Info",
            Metadata = "info"
        },
        new ContextMenuItem
        {
            Text = "Special Command",
            Metadata = "special"
        }
    };

        base.OnInitialized();
    }

    public class ContextMenuItem
    {
        public string Text { get; set; }
        public string Metadata { get; set; }
    }
}

---

Unplanned
Last Updated: 26 Apr 2023 13:23 by Jakub
Created by: Jakub
Comments: 0
Category: ContextMenu
Type: Feature Request
10
I'd like to prevent the Context Menu from closing when a user clicks on a parent item. The default behavior in most MS applications is that the Context Menu doesn't close after clicking on a parent item.
Unplanned
Last Updated: 11 Jan 2023 12:34 by ADMIN
Created by: Abhishek
Comments: 0
Category: ContextMenu
Type: Feature Request
6

Hello,

Please consider an OnHide event for the ContextMenu. Here is a scenario - the target's styles change when the Menu opens. There is no reliable built-in event that one can use to revert the styles back. The user can click on a Menu item, but they can also click somewhere else or hit Escape.

Currently, a possible workaround is to listen for clicks and keypresses on the document with JavaScript:

https://blazorrepl.telerik.com/mclcPUbJ49jerlsh57

Unplanned
Last Updated: 11 Apr 2022 11:26 by Adrian
Created by: Adrian
Comments: 0
Category: ContextMenu
Type: Feature Request
3
I would like to be able to hide the context menu when I scroll the browser. 
Unplanned
Last Updated: 16 Dec 2022 16:48 by Nate
Created by: Nate
Comments: 0
Category: ContextMenu
Type: Feature Request
2
Is it possible to get the same slide-down animation in the right-click context menu, that you see when you click one of the column filters in Grid? If not can you please add a feature request for that?
Unplanned
Last Updated: 23 Mar 2023 07:10 by Nathan
Created by: Nathan
Comments: 0
Category: ContextMenu
Type: Feature Request
2

Example use case is to have a context menu bound to a form item. The form item would re-render on submit that would change the dom element.

Example: https://blazorrepl.telerik.com/mxEnmnaV09ahp4EB15

Workaround: https://blazorrepl.telerik.com/mxkxwHOr08fcjSKK39

Completed
Last Updated: 14 Dec 2020 07:54 by ADMIN
Release 2.21.0
Created by: Patrik Madliak
Comments: 0
Category: ContextMenu
Type: Feature Request
1
I would like that the Context Menu has the Class parameter to make cascading custom CSS styles easier.
Completed
Last Updated: 18 Apr 2023 14:07 by ADMIN
Release 4.2.0 (04/26/2023)
Created by: Claudio
Comments: 0
Category: ContextMenu
Type: Feature Request
1
Pressing the "Reset" button does not update the textbox content. See: REPL link.
Completed
Last Updated: 02 Feb 2021 09:23 by ADMIN
Created by: Richard
Comments: 1
Category: ContextMenu
Type: Feature Request
0

Please allow the context menu to be used without a data source and run using templates only.

That way we can use this control to provide a popup of items that we can control, and don't have to set it up with sometime of blank list of items that are never used.