I saw some similar posts on this topic, but nothing that had a solution. Basically, I want to do the same thing as this poster here: http://news.infragistics.com/forums/p/13482/50108.aspx#50108
I see the same options in the context menu as he does.
What I want to do is only for some columns, I want to have my own context menu for those columns. Conditionally, on a cell by cell basis I want to have no context menu there, or a context menu with no items. But basically, I need to have a way to update the context menu right before it is about to get show to hide/show context menu items.
For other columns, I want to leave the default context menu in there.
Can this be done?
No control I know of allows you to specify a context menu on a single part of the control. What you have to do is apply the ContextMenu to the entire control and dynamically change it as the position of the mouse changes. So you would use the MouseMove event and trap where the mouse is and what it is over and change the ContextMenu based on that.
Here are some articles that show you how to tell what part of the grid the mouse is currently over:
HOWTO:UltraWinGrid Mouse Position and Cell Identification
HOWTO:UltraWinGrid Mouse Position and Column Identification
HOWTO:UltraWinGrid Mouse Position and Row Identification
I can figure out what cell I am in and show my context menu as long as the cell is not yet in edit mode.
If the cell is in edit mode, I am unable to override the context menu it is using to show my own.
It seems reasonable to want different columns to have different context menu options.