open a radcontextmenu on left click of a radbutton

2 posts, 0 answers
  1. Sigma
    Sigma avatar
    87 posts
    Member since:
    Apr 2012

    Posted 19 Oct 2012 Link to this post

    hii,
    How can i open a radcontextmenu on left click of a radbutton?


    thanks...
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 Oct 2012 Link to this post

    Hi Sigma,

    Try the following code snippet to achieve your scenario.

    ASPX:
    <telerik:RadButton ID="RadButton1" runat="server" Text="Show" OnClientClicked="OnClientClicked">
    </telerik:RadButton>
    <telerik:RadContextMenu ID="RadContextMenu1" runat="server"  >
         <Items>
              <telerik:RadMenuItem Text="RadMenuItem1">
              </telerik:RadMenuItem>
              <telerik:RadMenuItem Text="RadMenuItem2">
              </telerik:RadMenuItem>
              <telerik:RadMenuItem Text="RadMenuItem3">
              </telerik:RadMenuItem>
         </Items>
    </telerik:RadContextMenu>

    JS:
    <script type="text/javascript">
        function OnClientClicked(sender, args) {
            var contextMenu = $find("<%= RadContextMenu1.ClientID %>");
            contextMenu.show(args);
        }
    </script>

    Regards,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top