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.ResetCustomization does not work

I've created a MainFrameBarManager in my app and created one menu bar.
If I run the application, and remove the menu, then close the application my settings are saved.

Now, if I call mainFrameBarManager.ResetCustomization = true in the Form_Load event, when I shutdown and restart my app, the settings are still saved.

How can I reset my mainFrameBarManager's settings? If I set "AutoPersistCustomization = false" the menu loads fine. However as soon as I turn that setting back to true my menu does not appear.

How can I actually reset my menu settings?

4 Replies

LS Lingaraj S Syncfusion Team May 25, 2010 12:06 PM UTC

Hi Tom,

Thank you for your interest in Syncfusion products.

I am afraid that I was unable to reproduce the mention issue while using ResetCustomization in MainFrameBarManger. We have tested the issue with simple sample and attached in following link.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=MenuItemsInsertTest-947496804.zip


Please have look at the above sample and let me know if you still face the issue. Could you please try to reproduce the issue in above sample that would be helpful for us to provide a better solution?

Regards,
Lingaraj S.



TW Tom Warner May 25, 2010 07:33 PM UTC

Your sample works fine as it is, however when I try to add the same exact code to my application it throws a NullReferenceException when calling "MainMenuManager.Bars.Add(bar)".

Neither MainMenuManager, nor bar are null.

The exception details are:

at Syncfusion.Windows.Forms.Tools.XPMenus.CommandBarExt.AttachBarControl(BarControlInternal barControl)
at Syncfusion.Windows.Forms.Tools.XPMenus.CommandBarManager.BindBarInternal(Bar bar)
at Syncfusion.Windows.Forms.Tools.XPMenus.CommandBarManager.AttachMainMenuBar(Bar mainMenuBar)
at Syncfusion.Windows.Forms.Tools.XPMenus.CommandBarManager.BarCollectionChanged(Object sender, CollectionChangeEventArgs args)
at System.ComponentModel.CollectionChangeEventHandler.Invoke(Object sender, CollectionChangeEventArgs e)
at Syncfusion.Collections.ArrayListExt.Add(Object value)
at Syncfusion.Windows.Forms.Tools.XPMenus.Bars.Add(Object value)
at IdeaGenerationEditor.MainForm.InitializeMenus() in [My code from here]


TW Tom Warner May 25, 2010 09:21 PM UTC

I believe I solved this problem. I think it was happening due to how the MainFrameBarManager was getting initialized by not calling BeginInit correctly.


LS Lingaraj S Syncfusion Team May 26, 2010 09:33 AM UTC

Hi Tom,

Thanks for the update.

Regards,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon