[DevExpress Support Team: CLONED FROM T349473: Bars - The "Cannot access a disposed object" exception is thrown when repeatedly opening the font menus]
I believe I'm having the same issue in a production version of our product which is still using 11.2.14.
When I use the Ribbon linked to a rich text control, it works fine. But when I host a RichTextEdit as a repository item within a grid cell, opening the font settings crashes immediately with an ObjectDisposedException.
Leon, please provide the complete callstack, so that we сan get more details. We will do our best to help you resolve this issue.
Here it is
Cannot access a disposed object. Object name: 'RichEditFontSizeEdit'.
at System.Windows.Forms.Control.CreateHandle() at DevExpress.XtraEditors.BaseEdit.CreateHandle() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.SetVisibleCore(Boolean value) at System.Windows.Forms.Control.set_Visible(Boolean value) at DevExpress.XtraEditors.Container.ContainerHelper.ShowEditor(BaseEdit edit, Control container, Boolean checkForFocus) at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.ShowEditor(BarEditItemLink link, BaseEdit edit) at DevExpress.XtraBars.BarEditItemLink.ShowLinkEditor(Boolean byMouse) at DevExpress.XtraBars.BarEditItemLink.OnLinkAction(BarLinkAction action, Object actionArgs) at DevExpress.XtraBars.BarItemLink.OnLinkActionCore(BarLinkAction action, Object actionArgs) at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.DoPressedLinkChanging(BarItemLink oldLink, BarItemLink newLink, Boolean isArrow) at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.PressLinkCore(BarItemLink link, Boolean isArrow) at DevExpress.XtraBars.Ribbon.Handler.BaseRibbonHandler.OnPressItem(RibbonHitInfo hitInfo) at DevExpress.XtraBars.Ribbon.Handler.RibbonHandler.OnPressItem(RibbonHitInfo hitInfo) at DevExpress.XtraBars.Ribbon.Handler.BaseRibbonHandler.OnPressItem(DXMouseEventArgs e, RibbonHitInfo hitInfo) at DevExpress.XtraBars.Ribbon.Handler.BaseRibbonHandler.OnPress(DXMouseEventArgs e, RibbonHitInfo hitInfo) at DevExpress.XtraBars.Ribbon.Handler.RibbonHandler.OnPress(DXMouseEventArgs e, RibbonHitInfo hitInfo) at DevExpress.XtraBars.Ribbon.Handler.BaseRibbonHandler.OnMouseDown(DXMouseEventArgs e) at DevExpress.XtraBars.Ribbon.Handler.RibbonHandler.OnMouseDown(DXMouseEventArgs e) at DevExpress.XtraBars.Ribbon.RibbonControl.OnMouseDown(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at DevExpress.Utils.Controls.ControlBase.WndProc(Message& m) at DevExpress.XtraBars.Ribbon.RibbonControl.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at DevExpress.Utils.Win.Hook.ControlWndHook.CallWindowProc(IntPtr pPrevProc, IntPtr hWnd, Int32 message, IntPtr wParam, IntPtr lParam) at DevExpress.Utils.Win.Hook.ControlWndHook.WindowProc(IntPtr hWnd, Int32 message, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm)
Hello Leon,
I've created a sample project based on your description in order to reproduce the exception. However, the NullReferenceException exception occurs instead of ObjectDisposedException.
I've passed the ticket to our developers for further research. We will inform you as soon as we have any results.