We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Context Menu Client Side Code

Thread ID:

Created:

Updated:

Platform:

Replies:

79064 Jan 19,2009 10:48 AM Jan 20,2009 07:13 AM ASP.NET Web Forms (Classic) 1
loading
Tags: Tools
Stephen Girolami
Asked On January 19, 2009 10:48 AM

I'm trying to get the following javascript code to work:

var menu = $get( "m_menuVersionsContext" );
if( menu != null )
{
menu.ShowContextMenu(null,null,event,sData );
}

At runtime the actual name of the menu control is ct100_ContentPlaceHolder1_ct102_ct105_m_menuVersionsContext. How am I supposed to get hold of the context menu control when its name is so dynamic?

Thanks
Steve



Rekha P [Syncfusion]
Replied On January 20, 2009 07:13 AM

Hi Steve,

Thank you for your interest in Syncfusion Products.

In order to show the context menu, Menu control's ClientObjectId is used to access the ShowContextMenu method.
Please refer the code snippet below to achieve this.

[javascript]


function showcontextmenu(odata)
{
var bShowMenu = false; var oEvent = odata.Event;

MenuClientObjectId.ShowContextMenu( null, null, oEvent, odata ); //MenuClientObjectId is the ClientObjectId of Menu control

return bShowMenu;
}


Also please refer the sample below which illustrates the above.

http://websamples.sy ncfusion.com/samples/Tools.Web/6.3.0.6/52846_ContextMenu/main.htm

Please let me know if you have any concerns.

Thanks,
Rekha


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;