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

RegisterMdiChildTypes throw ApplicationException

I upgraded my application from 3.2 to 7.1, When the main form call RegisterMdiChildTypes to register a child form, the application crashed with stack trace:


Error Message: A BarItem not part of a BarManager's Items list is encountered.
Exception Type: System.ApplicationException
at Syncfusion.Windows.Forms.Tools.XPMenus.BarItemID.FromBarItem(BarItem item)
at Syncfusion.Windows.Forms.Tools.XPMenus.MergedBar.MergeBars(Bar[] bars)
at Syncfusion.Windows.Forms.Tools.XPMenus.MergedBar..ctor(Bar[] barsToMerge, BarManager manager)
at Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager.InitMergedBars()
at Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager.RegisterMdiChildTypes(Type[] formTypes, Form[] forms)
at Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager.RegisterMdiChildTypes(Type[] formTypes)

I figured out because in the main form, I remove references to some bar items (mainFrameBarManager.RemoveReferencesToBarItem) is the cause of the problem. My question is what I need to do in the child form or the main form to fix the problem, I cannot find what bar items in the child form that caused the merged problem, any hint to find them?

3 Replies

AD Administrator Syncfusion Team June 24, 2009 09:13 AM UTC

Hi Henry,

Sorry for the delayed response.

Can you please try reproducing the issue from the shipped sample located below or send us a sample illustrating the issue that would help us to sort out the issue?

..\Tools.Windows\Samples\2.0\Menus Package\MDI Demo

Thank you for using Syncfusion products.

Regards,
Jaya


HN Henry Nguyen July 1, 2009 09:31 PM UTC

Hi Jaya,

Thanks for the response, I was able to fix the problem. When We use RemoveReferencesToBarItem method on both ParentBarItem and BarItem, we get the exception. This exception is not thrown in 3.2, but in 7.1.

Henry.


AD Administrator Syncfusion Team July 7, 2009 09:57 AM UTC

Hi Henry,

We glad to hear that your issue has been resolved. Please let us know if you have any further issues.

Regards,
Jaya

Loader.
Live Chat Icon For mobile
Up arrow icon