Bug Report T311986
Visible to All Users

DockManager - AutoHideContainer throws NullReferenceException if an auto-hidden panel is deleted at design time

created 9 years ago

I had a XtraUserControl with two DockPanels in an AutoHideContainer docked on the right.
I deleted one of them and now I get design-time and runtime exceptions. Here is the runtime exception.

13/11/15 12:21:23.004 [*] (S) TIPSApp.HandleUnexpectedGUIThreadException
  (N) TIPSApp.IsHandled     : false
  (N) WinFormsApp.IsHandled : false
  (N) Exception             : System.NullReferenceException: Object reference not set to an instance of an object.
                                 at DevExpress.XtraBars.Docking.AutoHideContainer.get_IsHorizontal()
                                 at DevExpress.XtraBars.Docking.AutoHideContainerViewInfo.Calc(Graphics g, Rectangle bounds)
                                 at DevExpress.XtraBars.Docking.AutoHideContainer.OnPaint(PaintEventArgs e)
                                 at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
                                 at System.Windows.Forms.Control.WmPaint(Message& m)
                                 at System.Windows.Forms.Control.WndProc(Message& m)
                                 at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
                                 at System.Windows.Forms.ContainerControl.WndProc(Message& m)
                                 at DevExpress.XtraBars.Docking.ZIndexControl.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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
13/11/15 12:21:29.335 [*] (E) TIPSApp.HandleUnexpectedGUIThreadException (result: "User cancelled shutdown")

I have tried it different ways - pressing Del; deleting from Document Outline; deleting from DockManager Customize & Designer. Same result.

Attached is a zip file with working/broken files so you can diff them if that helps.

Comments (1)
DevExpress Support Team 9 years ago

    Hi,

    We have successfully reproduced the behavior you described and passed this ticket to our developers' team for further research. Please bear with us. We will notify you as soon as we make any progress.

    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.

      Show previous comments (2)
      DevExpress Support Team 9 years ago

        Hi,

        It is strange that the PerformLayout method is called in the InitializeComponent method. Have you ever modified the designer's file manually?

        In any case, comment this method call and replace the following string:

        C#
        this.dpFields.SavedDock = DevExpress.XtraBars.Docking.DockingStyle.Fill;

        with this one:

        C#
        this.dpFields.SavedDock = DevExpress.XtraBars.Docking.DockingStyle.Right;

        Then, re-build your application (CTRL+SHIFT+B). Now, your UserControl should be shown correctly.

        I look forward to your results.

          The call to PerformLayout() isn't in the original code - it only appears when I delete dpComponents in the designer.
          Changing that line fixed the problem - no crash in the designer and no crash at runtime!
          Thanks!

          DevExpress Support Team 9 years ago

            Thank you for informing us that the issue has been resolved. Please do not hesitate to contact us in case of any difficulty. We will be happy to help you!

            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.