Hi All,
I am using .Net 4.0 [Visual Studio 2010], Telerik version 2013.
I am facing an issue with the Rad Context menu, when I try to call the RadContextMenu using the "onmouseup" event it is not working. Actually the menu is coming and disappearing immediately. But the same code is working for "onclick" and other events.
Is there any issue with RadContextMenu in 2103 Telerik version. Please help me to resolve.
Below the code which I used to call the menu,
<form id="form1" runat="server">
<asp:ScriptManager runat="server" ID="asps"></asp:ScriptManager>
<div onmouseup="showMenu(event)" runat="server" onmouseup="return false" id="div1">
<asp:Literal ID="literal1" runat="server">
This is sample text to test the Rad context menu
</asp:Literal>
<telerik:RadContextMenu ID="RadContextMenu1" runat="server"
EnableRoundedCorners="true" EnableShadows="true">
<Items>
<telerik:RadMenuItem Text="Trees" />
<telerik:RadMenuItem Text="Sunset" />
<telerik:RadMenuItem Text="Mountains" />
</Items>
</telerik:RadContextMenu>
</div>
<telerik:RadScriptBlock runat="server">
<script type="text/javascript">
function showMenu(e) {
var contextMenu = $find("<%= RadContextMenu1.ClientID %>");
$telerik.cancelRawEvent(e);
if ((!e.relatedTarget) || (!$telerik.isDescendantOrSelf(contextMenu.get_element(), e.relatedTarget))) {
contextMenu.show(e);
}
}
</script>
</telerik:RadScriptBlock>
</form>
Thanks in advance.
I am using .Net 4.0 [Visual Studio 2010], Telerik version 2013.
I am facing an issue with the Rad Context menu, when I try to call the RadContextMenu using the "onmouseup" event it is not working. Actually the menu is coming and disappearing immediately. But the same code is working for "onclick" and other events.
Is there any issue with RadContextMenu in 2103 Telerik version. Please help me to resolve.
Below the code which I used to call the menu,
<form id="form1" runat="server">
<asp:ScriptManager runat="server" ID="asps"></asp:ScriptManager>
<div onmouseup="showMenu(event)" runat="server" onmouseup="return false" id="div1">
<asp:Literal ID="literal1" runat="server">
This is sample text to test the Rad context menu
</asp:Literal>
<telerik:RadContextMenu ID="RadContextMenu1" runat="server"
EnableRoundedCorners="true" EnableShadows="true">
<Items>
<telerik:RadMenuItem Text="Trees" />
<telerik:RadMenuItem Text="Sunset" />
<telerik:RadMenuItem Text="Mountains" />
</Items>
</telerik:RadContextMenu>
</div>
<telerik:RadScriptBlock runat="server">
<script type="text/javascript">
function showMenu(e) {
var contextMenu = $find("<%= RadContextMenu1.ClientID %>");
$telerik.cancelRawEvent(e);
if ((!e.relatedTarget) || (!$telerik.isDescendantOrSelf(contextMenu.get_element(), e.relatedTarget))) {
contextMenu.show(e);
}
}
</script>
</telerik:RadScriptBlock>
</form>
Thanks in advance.