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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Null Ref Exception in docking code

Thread ID:

Created:

Updated:

Platform:

Replies:

30933 Jun 27,2005 08:54 PM UTC Jul 5,2005 04:01 PM UTC WinForms 4
loading
Tags: Tools
Gus Felderhoff
Asked On June 27, 2005 08:54 PM UTC

With the following code, I am able to create a situation in which I get a null reference exception. To reproduce, paste this into a load event on a form. Control ctrl1 = new ListView(); Control ctrl2 = new ListView(); Control ctrl3 = new ListView(); Control ctrl4 = new ListView(); Control ctrl5 = new ListView(); m_DockingManager = new DockingManager(); m_DockingManager.BeginInit(); m_DockingManager.HostForm = this; m_DockingManager.DockToFill = true; m_DockingManager.DockControl(ctrl1, this, DockingStyle.Fill, 200); m_DockingManager.DockControl(ctrl2, ctrl1, DockingStyle.Right, 200); m_DockingManager.DockControl(ctrl3, ctrl2, DockingStyle.Tabbed, 200); m_DockingManager.DockControl(ctrl4, ctrl2, DockingStyle.Tabbed, 200); m_DockingManager.DockControl(ctrl5, ctrl1, DockingStyle.Bottom, 200); m_DockingManager.SetDockLabel(ctrl1, "ctrl1"); m_DockingManager.SetDockLabel(ctrl2, "ctrl2"); m_DockingManager.SetDockLabel(ctrl3, "ctrl3"); m_DockingManager.SetDockLabel(ctrl4, "ctrl4"); m_DockingManager.SetDockLabel(ctrl5, "ctrl5"); m_DockingManager.EndInit(); Run the app. Double click on the pane labeled "ctrl4" and it undocks. Double click on it again and it will cause the exception. I am using version 3.0.1.0. Any help would be greatly appreciated.

Administrator [Syncfusion]
Replied On June 28, 2005 06:28 PM UTC

Hi Gus, There were a few issues in v3.0.1.0 that caused DockingManager to throw exceptions. These fixes, along with a number of other fixes, are included in v3.2.1.0 and I would recommend upgrading if possible. Regards, Gregory Austin Syncfusion Inc.

Gus Felderhoff
Replied On July 1, 2005 05:17 PM UTC

Thank you Gregory. I did as you recommended, and no longer get the exception. Although, now when I follow the steps outlined in the original post, the individual panes that were tabbed before undocking are now untabbed when redocking. Is there a way around this?

Gus Felderhoff
Replied On July 1, 2005 05:20 PM UTC

In addition, now when I first bring up my application, the code posted above does not display any windows on my form.

Gus Felderhoff
Replied On July 5, 2005 04:01 PM UTC

I have found a work around in which everything works as expected. I have used a DockingClientPanel for the ''main'' panel within my form. Control ctrl1 = new ListView(); Control ctrl2 = new ListView(); Control ctrl3 = new ListView(); Control ctrl4 = new ListView(); Control ctrl5 = new ListView(); DockingClientPanel panel; this.components = new System.ComponentModel.Container(); m_DockingManager = new DockingManager(); m_DockingManager.BeginInit(); panel = new DockingClientPanel(); panel.SizeToFit = true; this.Controls.Add(panel); m_DockingManager.HostForm = this; m_DockingManager.ThemesEnabled = true; panel.Size = this.ClientSize; ctrl1.Dock = DockStyle.Fill; panel.Controls.Add(ctrl1); m_DockingManager.DockControl(ctrl2, this, DockingStyle.Right, 200); m_DockingManager.DockControl(ctrl3, ctrl2, DockingStyle.Tabbed, 200); m_DockingManager.DockControl(ctrl4, ctrl2, DockingStyle.Tabbed, 200); m_DockingManager.DockControl(ctrl5, this, DockingStyle.Bottom, 200); m_DockingManager.SetDockLabel(ctrl2, "ctrl2"); m_DockingManager.SetDockLabel(ctrl3, "ctrl3"); m_DockingManager.SetDockLabel(ctrl4, "ctrl4"); m_DockingManager.SetDockLabel(ctrl5, "ctrl5"); m_DockingManager.EndInit();

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;