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
685
Share ultratoolbarsmanager among ultragrids ?
posted

In my application, every UltraGrid has a "GridController" class that is responsible of the grid management ( Fill & Set datasource, InitializeLayout, all grid events, ...).

I want to set context menu to my grids. Some context menu options are the same for all grids ( Add rows, delete rows, ...) and some are grid specific.

Context menu options in a grid may also depends on which band is selected. Some row values may also affect which menu options is enabled/visible.

I want the context menu options to be accessible with keyboard shortcut. It is possible that while in a grid, a particular shortcut does something, and while in another grid, does something else.

Ok, now here is a specific situation:  I have a form with 2 ultratabs, each one having an UltraGrid. I would like each UltraGrid (GridController) to be responsible to create (at runtime) its context menu options, and before showing the context menu,assign the enabled/visible properties of tools depending on the selected rows.

Based on this scenario, I'm wondering what is the recommended way to create the ultratoolbarsmanager ?

1- Only one ultratoolbarsmanager created in the form and shared by both Ultragrid. In that case, I'm concerned about events conflict between the two grids (toolclick, shortcut,..).

2- Each Ultragrid (GridController) has it's own ultratoolbarsmanager created at run-time. In that case, what is the proper way to create ultratoolbarsmanager at run-time ? Does it absolutly need a container to be docked in ?

3- Any other suggestion is welcomed.

Thanks,

Guillaume