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
65
Event for rightclick in WebGrid?
posted

Hi,

I want to add a contextmenu to the webgrid. But I could not found the event for a rightclick of the mouse.

I have put the webgrid in a div-section and bound the contextmenu to the div-tag, but then the contextmenu appears at wrong position (not there, where I rightclicked)

Any idea? Thanks

 

 

Parents
  • 2211
    posted

    Man34 -

    When trapping the right click event for the grid you use the client side event handler: CellClickHandler

    Ex:

    function UltraWebGrid1_CellClickHandler(gridName, cellId, button){
    	if(button == 2) { 
    		// Cancel the show of IE context menu
    		event.returnValue = false;
    		event.cancelBubble = true;
    		// Show your context menu
    		igmenu_showMenu('UltraWebMenu1', event); 
    		return true; 
    	} 
    }
     
    Patrick
Reply Children