Bug Report T359497
Visible to All Users

NullReferenceException occurs if the "Font" menu item of RepositoryItemRichTextEdit is clicked and the repository item is placed into RibbonControl.

created 9 years ago

[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.

Comments (3)
DevExpress Support Team 9 years ago

    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)

      DevExpress Support Team 9 years ago

        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.

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.