Hi All,
I need to display the context menu when I right click on the grid even if there are no rows in the grid. I used CellClickHandler and MouseUp event Handler. Both of them in vain. Please let me know how to implement this.
Regards,Abhi
Hello Abhi,
When the grid has not data, it simply displays the "no data" message and does not really expose any events, cell / header / row collections, etc, etc. I believe this is the normal and expected behaviour.
So in the case where the grid is empty and your datasource has 0 records, you will need to handle this by yourself - you can just create any HTML element and nest the grid there, the handle the onclick event of the element and use code similar to what Ivan showed above to show the menu.
So you will just need to popup a generic context menu and do not rely on grid client-side events for that when there is no data.
Hope this helps.