ASPX
<script type="text/javascript">
//<![CDATA[
function showMenuAt(e) {
var contextMenu = $find("RadContextMenu1.ClientID");
var x = parseInt($get("contextX").value);
var y = parseInt($get("contextY").value);
if (isNaN(x) || isNaN(y)) {
alert("Please provide valid integer coordinates");
return;
}
contextMenu.showAt(x, y);
$telerik.cancelRawEvent(e);
}
function showMenu(e) {
var contextMenu = $find("RadContextMenu1.ClientID");
if ((!e.relatedTarget) || (!$telerik.isDescendantOrSelf(contextMenu.get_element(), e.relatedTarget))) {
contextMenu.show(e);
}
$telerik.cancelRawEvent(e);
}
//]]>
</script>
<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>
And from VB.net codebehind I try to SHOW the popup.
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "reloadamchart" & Guid.NewGuid.ToString, "showMenu(e);", True)
Another tricky part is that Google Map right_click gives you map coordinates lat/lng insted of the client pixel where the right click took place. I gues all clients will have different screen resolutions making this very difficult ?
'This is example of what I would like to accomplish using RadContextMenu.
http://googlegeodevelopers.blogspot.se/2009/09/introducing-contextmenucontrol-10-give.html
http://econym.org.uk/gmap/example_context.htm
<script type="text/javascript">
//<![CDATA[
function showMenuAt(e) {
var contextMenu = $find("RadContextMenu1.ClientID");
var x = parseInt($get("contextX").value);
var y = parseInt($get("contextY").value);
if (isNaN(x) || isNaN(y)) {
alert("Please provide valid integer coordinates");
return;
}
contextMenu.showAt(x, y);
$telerik.cancelRawEvent(e);
}
function showMenu(e) {
var contextMenu = $find("RadContextMenu1.ClientID");
if ((!e.relatedTarget) || (!$telerik.isDescendantOrSelf(contextMenu.get_element(), e.relatedTarget))) {
contextMenu.show(e);
}
$telerik.cancelRawEvent(e);
}
//]]>
</script>
EnableRoundedCorners="true" EnableShadows="true">
<Items>
<Telerik:RadMenuItem Text="Trees" />
<Telerik:RadMenuItem Text="Sunset" />
<Telerik:RadMenuItem Text="Mountains" />
</Items>
</Telerik:RadContextMenu>
And from VB.net codebehind I try to SHOW the popup.
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "reloadamchart" & Guid.NewGuid.ToString, "showMenu(e);", True)
Another tricky part is that Google Map right_click gives you map coordinates lat/lng insted of the client pixel where the right click took place. I gues all clients will have different screen resolutions making this very difficult ?
'This is example of what I would like to accomplish using RadContextMenu.
http://googlegeodevelopers.blogspot.se/2009/09/introducing-contextmenucontrol-10-give.html
http://econym.org.uk/gmap/example_context.htm