In a ultragrid when the cursor is placed inside a cell, on pressing the right mouse button, a standard contextmenu
containing items like "open IME", cut, copy, paste is displayed.
Is there a possibility to suppress that kind of menu in order to replaced it by a customized menu ?
like e.DisplayPromptMsg = false in the handler BeforeRowDeleted ? in order to suppress the standard delete confirmation dialog ??
You can set the ContextMenu property on the grid just like on any other control and your ContextMenu will replace the default one.
Hi Mike,
thanks for your suggestions. Unfortunately in the case of this contextmenu
(contains items: cancel,-, cut, copy, past, delete,-, select all, open IME)
it doesn't work. It seems to be a Windows XP menu.I tried to trace exactly what happened with spy++ there I can see that on pushing the right mouse buttonover der activated cell a WM_MOUSEACTIVATE event is fired.
But even when I override the WndProc handler no handler is called before the contextmenu is displayed.
protected override void WndProc(ref Message m) { //etc. if (m.Msg == WM_MOUSEACTIVATE) MessageBox.Show("test"); } No idea where I can suppress this menu?
I've got the same question as the original one was.
To reproduce the issue: right click the cell THAT IS IN EDIT MODE.
How to suppress this menu?
-Vitaly
Hi Vitaly,
I'm pretty sure that your question is answered above more than once.
It you assign an empty ContextMenu to the grid control before you enter edit mode on the cell, then that context menu will be assigned to the editor control of the cell and thus nothing will show up.
A detail about this point should be mentionned:
I always tried to suppress the menu by assigning the following
ultraGrid1.ContextMenu = null; //>>>nok!
However if you assign a empty menu it works!
ultraGrid1.ContextMenu = menu; //ok!
Thank for your contributions
Kagel
hi,i have a similar issue, however i need to handle the right click event. however if you setup a blank context menu the right click event doesn't get fired. It works if you aren't focused on the control, but not if you are in edit mode in the control and you right click inside it.I am specificaly talking about textboxes here, not in grids, sorry i just saw where this post was made originaly.I've tried the mousedown and mouseclick events and both have their right click events masked if you have an empty context menu.Any ideas? Our whole app is run from right clicking to fire up pick forms.RegardsChris
This doesn't have anything to do with the ContextMenu.
FAQ:Mouse events such as MouseDown, MouseUp, and DoubleClick do not fire when the mouse is over a cell that is in edit mode.