Changing ContextMenu

  • Thread starter Thread starter Libby Sharf
  • Start date Start date
L

Libby Sharf

Hello,
I have several ContextMenus and I want to connect them to the GridControl's
ContextMenu property depending on the row that was right clicked. Is there
an event that is raised just before the ContextMenu is displayed? (In Delphi
we used to have the ContextPopup event and we could change the ContextMenu
there.)
What is the best way to achieve this?

Libby
 
Hi,
just like in Delphi the ContextMenu has an event called Popup. This is where
you want to put your code.

Michael
 
Thanks... But what if, as I said, I'm using several ContextMenus and
switching betwwen them? Do I have to populate each one of them with the same
event handler for popup? Wouldn't it be much less cumbersome if only the
component they are attached to raise the event?
Does anyone know if there is such event that the component raise?
 
Guess then you will need to use the mousedown-event...

Or create one single, empty contextmenu. on every popup you clear it and
merge it with the correct contextmenu.

But usual practice is (at least for me) to put alle the items in one
contextmenu and disable or hide the ones not needed on popup.
 
Back
Top