ContextMenu closing problem

2 posts, 0 answers
  1. Andreas
    Andreas avatar
    143 posts
    Member since:
    May 2008

    Posted 23 May 2013 Link to this post


    This is not a big issue, but is a little bit irritating...
    When clicking an item of a contextmenu, it closes automatically, this is ok for most items.
    But when clicking an item that has subitems I didn't expect it to close automatically. Some users has a habit to click to expand even if they don't have to (hover expands)...
    Also when clicking on separators it closes, didn't expect that either...

    <!DOCTYPE html>
    <head runat="server">
        <form id="form1" runat="server">
            <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
                <telerik:RadContextMenu runat="server" ID="ctx">
                        <telerik:ContextMenuElementTarget ElementID="test" />
                        <telerik:RadMenuItem Text="Item 1" />
                        <telerik:RadMenuItem Text="Item 2" />
                        <telerik:RadMenuItem IsSeparator="true" />
                        <telerik:RadMenuItem Text="Item 3" />
                        <telerik:RadMenuItem Text="Item 4">
                                <telerik:RadMenuItem Text="Item 5" />
                                <telerik:RadMenuItem Text="Item 6" />
                <div id="test" style="width: 300px; height: 300px; background-color: red">
                    Right click here!
    I don't think it should close when clicking on "Item 4" or when clicking on the separator!

  2. Boyan Dimitrov
    Boyan Dimitrov avatar
    1966 posts

    Posted 28 May 2013 Link to this post


    Thank you for contacting Telerik Support.

    An easy and convenient way of achieving such functionality would be to use the the RadContextMenu ClientHiding client-side event and cancel it based on some custom condition.
    //markup code
    <telerik:RadContextMenu ID="radContextMenu1" runat="server" OnClientHiding="ClientHiding"></telerik:RadContextMenu>


    function ClientHiding(sender, args) {
        if (/*some custom condition goes here */) {

    Boyan Dimitrov
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top