Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
508
WebMenu giving problem when used in UserControl
posted

I am using WebMenu as a contextmenu for ultrawebgrid cells. The contextmenu works fine if I place the webgrid and webmenu directly in the page. The problem starts when I am trying to create a usercontrol using webgrid and webmenu, contextmenuclick(right click on grid cell) gives me an error saying "Popup name not valid".

The code for showing the contextmenu is

igmenu_showMenu("<%=this.MROContextMenu.ClientID %>",null,0,0);

Can somebody point what I am missing!!

Thanks

Parents Reply
  • 19308
    posted in reply to sairam

    Take a look at the Excel Copy & Paste sample in the samples browser.  I spent a good day banging my head against the wall trying to figure out how to get a context menu positioned correctly cross browser, so I definitely feel your pain.  As much as I understand why firefox doesn't have a global "event" object, it sure makes things hard :)  The key is to pass the "event" parameter into the function as a parmeter.  Firefox will always use the first parameter in an event handler as the event object. 

    Then you can calculate the position using the event object.  A warning though - calculating positions cross browser is another headache.  Lastly, you want to be sure to call igmenu_showMenu as you're doing above (menuid, null, x,y).  I remember running into an issue with quotations not being correctly placed around my ID under some odd configuration, so you'll want to do a quick views source on your HTML page to be sure that <%= ...%> is actually rendering out what you think it should. 

    hth,

    -Tony

     

Children