Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
310
Same Context Menu on two controls - how to determine Owner control
posted

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.

Parents
No Data
Reply
  • 6158
    Suggested Answer
    Offline posted

    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

Children