Hi,I have below requirement.I want to display default context menu on the grid(cut/copy/paste etc..) when cell is in edit mode. But when cell is not in edit mode, I want
to display my own contextmenu strip.I tried making contextmenustrip property null on Afterentereditmode event and then reassign my contextmenustrip on afterexiteditmode event
but did not helo. It always shows the contextmenu strip which i assigned in afterexitmode event .I tried in MouseUp event and handle the right click as well to do the same as above (check if cell is in edit mode or not and accordingly show the contextmenustrip)
but when cell is in edit mode then mouseup event does not get fired.Please help..
Thanks
Hello pravinkumard,
What you could do is to assign a contextmenustrip on initializing of the WinGrid, then catch the AfterEnter and AfterExit edit mode events and do something like the following:
private void ultraGrid1_AfterEnterEditMode(object sender, EventArgs e) { ultraGrid1.ContextMenuStrip.Items.RemoveAt(0); ultraGrid1.ContextMenuStrip.Items.Add("ENTERED"); } private void ultraGrid1_AfterExitEditMode(object sender, EventArgs e) { ultraGrid1.ContextMenuStrip.Items.RemoveAt(0); ultraGrid1.ContextMenuStrip.Items.Add("EXITED"); }
Please do not hesitate to contact me if you need any additional assistance.
Hi Boris,
Thanks for your quick reply.
As i said in my original post that I have already tried the AfterEnterEditMode and AfterExitEditMode but does not work.Let me clarify once again the problem.I need to display the default context menu which is available on the ultragrid in edit mode(cut/Copy/Paste/Select All etc) but when cell is not in edit menu i want to display
my app specific context menu.The said solution always shows "ENTERED". Please reply