I have two grids on a form. I have set the same right-click context menu on both grids (ultraToolbarsManager.SetContextMenuUltra) using a wintoolbar. How can I determine the underlying source control (i.e. either grid1 or grid2).
I will performing something similar on many forms, so I do not want to have to code in a MouseDown event on all the grids. I really want a way to determine this dynamically. Thanks for any ideas.
Hello Bob,
When the UltraToolbarsManager displays a context menu (PopupMenu), it will fire the BeforeToolDropDown event. The eventargs for this event will expose the Tool being displayed and the SourceControl which is the control for which the context menu is being shown. In your case, the Source control should return the grid being clicked on.
Let me know if you have any further questions. Thanks,
Chris
The e.SourceControl value in my case returns a value of "Nothing". The form inherits from a baseform. The ToolBarManager is on the baseform. This could be why it is returning "Nothing"?
I appreciate any other ideas as a work around? Thanks.