Hello,
I have a form with a dock manager and a tabbedMdiManager managing the main window. Panes may be instantiated as DockableMdi panes or Mdi forms only. I am using the IPersistComponentSettings interface methods to save and load my form settings. When saving automatically, the SaveComponentSettings is called in the Dispose() method of the controls. I also offer the user the option to turn off the automatic save, via a toolbar button that sets SaveSettings = false with another toolbar button to SaveLayout where I directly call the SaveComponentSettings method.
These two scenarios result in different user.config files for the UltraTabbedMdiManager. When called directly the user config file maintains the settings for all tabs including those hosting dockable control panes. When called automatically (via Dispose methods) the user.config file only records the mdi tabs without dockable control panes. I suppose this might be a result of the order the dispose methods are called in that if the DockManager disposes first, the tabs would be gone when the TabbedMdiManager disposes and saves its own settings.
I am trying to align these save methods with the load methods. Should I be manually Saving all tabs before disposing any controls OR in the manual methods remove the dockable panes before saving Settings for the MdiManager tabs?
Also, I was wondering if there was a way for the MdiManager to self discover the correct form to put on a tab? I have done this for the DockManager where I add the controls to the MainForm and for the ExplorerBar where I add the controls to an UltrExplorerBarContainer and add the container to the ExplorerBar.Controls(). I have found no way to get the MdiManager to find the correct childForm. Any ideas on this?
Thanks, Wendy
I read your scenario very deeply and if I am understanding you correctly your MDITabs could be in a dock panes. If so you should first save the settings of the UltraDockManager then UltraTabbedMdiManager because in your UltraDockManager wraps your UltraTabbedMdiManager.
When you load the settings you should load UltraTabbedMdiManager and then UltraDockManager, because of UltraDockManager should create its panes based on the UltraTabbedMdiManager tabs.
UltraTabbedMdiManager saves only the layout of the control (ordering of MdiTabs, grouping of MdiTabs, appearance and etc.) and not the underling forms, so you should save the information about the underling forms manually.
Please let me know if you have any further questions or I am missing something.
Hello Hristo,
I've tried the suggestions to save the components Dock Manager then TabbedManager manually rather than rely on the automatic SaveComponents call as part of the Dispose method. Although when loading, I load the DockManager then MdiManager. This is now returning all the correct dock panes and tabs.
I believe my form has the DockManager as a peer of the TabbedMdiManager in that a Dcp may be hosted on the mainForm or on the childForm of a tab. When on the child form, the DockManager retains the history of where the pane was docked, but doesn't "dock" the pane. The TabbedMdiManager recognizes all child forms of the Main form. So, I have taken your suggestion but reversed the order and load the DockManager first which puts the dockable controls on the main form or child forms. Then, MdiManager loads with the child forms are already instantiated. I use the RestoreTab event to align the tabs with the child forms.
Thanks,Wendy
Thank you for your feedback.
As far as I understand from your latest post you were able to solve your issue. Please let me know if you have any further questions on this matter.
Thank you for using Infragistics Components.