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
3555
Set Context Menu of Grid in MDI application
posted
In my MDI application, I was wondering if it is possible to set the context
menu of the grids on the child forms all to the same menu that is setup in
my main form? Or do I have to add a toolbar to each subform?
  • 469350
    Verified Answer
    Offline posted

    Hi,

        Well... I don't see any way you could do this at design-time. At design-time, when you look at a control on a form with a ContextMenu, that control appears to have a ContextMenu property. But this is really an illusion. The ContextMenu provides this property to the control. So since your child forms won't have a ContextMenu on them, the grid won't have the property. 

        At run-time there must be a SetContextMenu method on the ContextMenu. Or if you are using UltraToolBars, there's a SetContextMenuUltra method on the UltraToolbarsManager component. You could try calling this method and passing in the grid on the child form at run-time and see if it works. I'm not sure it will, but I can't see any reason why it would not work.