Disable Context Menu for grid Header


How do I disable a context menu only for the grid header ? I tried using,


grdEvent._doHContClick =function(){


return false;


But it throws an error “that._showHContext is not a function” , I have included the dhtmlxgrid_hmenu.js but it doesnt help.

Grid’s context menu will work only for the rows. If you want disable browser’s context menu:

mygrid.hdr.oncontextmenu=function(){return false};

Note that in Opera it’s impossible to block native context menu.

Is there any particular js file to be included for the above to work as required ? I tried using the above solution but it does not work.

When I right click on the grid header the context menu is appearing, but the context menu should be appearing only in case of right click on the grid rows and not on the header.


Please check if you are calling this method after grid was fully loaded:


mygrid.hdr.oncontextmenu=function(){return false};