open and close radcontext menu on click of same button

2 posts, 0 answers
  1. Toad
    Toad avatar
    4 posts
    Member since:
    Oct 2011

    Posted 10 Feb 2012 Link to this post

    I have radcontextmenu which opens on click of a button, after opening it should stay open until same button is clicked again, but when I click that button again instead of closing it, the button reopens the context menu, please help.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Feb 2012 Link to this post

    Hello,

    Try the following javascript.
    JS:
    <script type="text/javascript">
       var i = 0;
      function showMenu(args)
      {
         var menu = $find("<%=RadContextMenu1.ClientID %>");
          if (i == 0)
           {
            menu.show(args);
            i = 1;
           }
          else
            {
            menu.hide();
            i=0;
           }
       }
    </script>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top