We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

MainFrameBarManager Save/Load with runtime created bar and item

Hi, All items and toolbars are created at runtime. The save and load do not work. But if I created manually some toolbars at runtime... when I restart the application, the toolbar reappear but no item in it. What I need to do ? Best regards, Martin

13 Replies

AD Administrator Syncfusion Team February 25, 2005 12:18 PM

Hi Martin, Are you able to provide a sample that demonstrates this problem? Regards, Gregory Austin Syncfusion Inc.


MB Martin Bonneville February 25, 2005 01:26 PM

Hi Gregory, I can''t upload file with the attach button. The popup appear but never end loading ! :-( Do you have an E-mail where I can send you my test application ? Regards, Martin


AD Administrator Syncfusion Team February 25, 2005 01:47 PM

Hi Martin, You can send me the attachment directly at gregorya@syncfusion.com Regards, Gregory Austin Syncfusion Inc.


MB Martin Bonneville February 25, 2005 01:59 PM

Hi Gregory, Mail sent... Regards, Martin


AD Administrator Syncfusion Team February 25, 2005 03:17 PM

Hi Martin, To do what I think you''re trying to do, you''ll want to manually Load and Save your Bar state with MainFrameManager.LoadBarState and MainFrameBarManager.SaveBarState. Currently the loading of your bar state is failing because it occurs before you create the BarItems, so it can''t add them to the Bar. Regards, Gregory Austin Syncfusion Inc.


MB Martin Bonneville February 25, 2005 03:59 PM

Hi Gregory, Can I use the automatic save and load manualy? If yes, can you give me an example of the load sequence? Thank Best regards, Martin


MB Martin Bonneville February 28, 2005 01:42 PM

Hi Gregory, Do you have an example for me ? Regards, Martin


AD Administrator Syncfusion Team March 1, 2005 12:45 PM

Hi Martin, Please refer to the test sample attached. It shows you how you could load/save menu state information manually using the MainFrameBarManager''s LoadBarState/SaveBarState methods. 1. Run the sample 2. Press the "Add Menus" button 3. Float the toolbar 4. Press "Save" button to save the menu state information 5. Close the application 6. Reload the application 7. Press the "Load" button to restore the menu state information You will see that the saved menu state information is correctly restored. Let me know if you need further assistance. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


AD Administrator Syncfusion Team March 1, 2005 12:48 PM

Hi Martin, After step (6) above, press the "Add Menus" button again to recreate the menus before movingto step (7). Note that the LoadBarState/SaveBarState methods can only restore/save state information and cannot create/delete the menu bars or items. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


MB Martin Bonneville March 1, 2005 01:24 PM

Hi Guru, Thank for you sample. I try it in my application, all work fine for saving state of "default" bars and items. If I add items, menus (or check the Large icons checkbox) with customization dialog, all the customization is lost. I need to do something special to save the user customization ? Best regards, Martin


AD Administrator Syncfusion Team March 2, 2005 10:40 AM

Hi Martin, I''ve done some more research into this and XPMenus only supports loading customization data during the initialization of the MainFrameBarManager. You should still be able to create BarItems at Runtime, but you''ll have to create them in the Constructor. I apologize for the confusion. Please let me know if you have any further questions. Regards, Gregory Austin Syncfusion Inc.


MB Martin Bonneville March 2, 2005 01:24 PM

Hi Gregory, The loading work fine with "default" bars and items. (bars and items always created by the application) Only the custom bars (created by user at runtome) are not saved or loaded. Then what you say is: Custom bars can be loaded only in form constructor (just after InitializeComponents) ? Best regards, Martin


AD Administrator Syncfusion Team March 2, 2005 01:58 PM

Hi Martin, I believe that you would need to remove the MainFrameBarManager initialization code from InitializeComponent and place that in the same place where you add your BarItems. The best place for this would be the constructor, but it might work in in the Load event handler. Regards, Gregory Austin Syncfusion Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon