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

NullReference Exception when closing simple docking application

Hi! I''m using Syncfusion version 2.1.0.9. I get a NullReference Exception when I close my sample app. Here are some sample code: dockingManager1.DockControl(new TreeView(), this, Syncfusion.Windows.Forms.Tools.DockingStyle.Left, 150); dockingManager1.DockControl(new TreeView(), this, Syncfusion.Windows.Forms.Tools.DockingStyle.Left, 150); dockingManager1.DockControl(new TreeView(), this, Syncfusion.Windows.Forms.Tools.DockingStyle.Left, 150); If I close the application before focusing on any of the controls I get an exception. But if I select one of the controls before closing the app it works. If I put all three controls like tabs in one window I don''t get the error either. Thanks, Urban.

2 Replies

AD Administrator Syncfusion Team September 16, 2004 10:15 AM UTC

Hi Urban, This issue was recently reported by our customers who had installed the service pack1 for the .Net framework 1.1 and we are already working on fixing this issue. For now could you please use the following workaround : Handle the host form''s Closing event and explicitly dispose off all the controls associated with the DockingManager and the DockingManager itself. private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { IEnumerator ienum = this.dockingManager1.Controls; ArrayList dockedctrls = new ArrayList(); while(ienum.MoveNext()) dockedctrls.Add(ienum.Current); foreach(Control ctrl in dockedctrls) { this .dockingManager1.SetEnableDocking(ctrl, false); ctrl.Dispose(); } this.dockingManager1.Dispose(); } Please let me know how it goes. Thanks. Best regards, Stephen. >Hi! > >I''m using Syncfusion version 2.1.0.9. > >I get a NullReference Exception when I close my sample app. > >Here are some sample code: > >dockingManager1.DockControl(new TreeView(), this, Syncfusion.Windows.Forms.Tools.DockingStyle.Left, 150); > >dockingManager1.DockControl(new TreeView(), this, Syncfusion.Windows.Forms.Tools.DockingStyle.Left, 150); > >dockingManager1.DockControl(new TreeView(), this, Syncfusion.Windows.Forms.Tools.DockingStyle.Left, 150); > >If I close the application before focusing on any of the controls I get an exception. But if I select one of the controls before closing the app it works. > >If I put all three controls like tabs in one window I don''t get the error either. > >Thanks, Urban.


UN Urban Nilsson September 17, 2004 03:29 AM UTC

It worked! Thanks!

Loader.
Up arrow icon