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

DockingManager Dispose problem

Thread ID:





46431 Jul 12,2006 10:04 PM UTC Aug 14,2006 04:07 AM UTC WinForms 11
Tags: Tools
Julie Levy
Asked On July 12, 2006 10:04 PM UTC

Hi - i''m trying to use the recommended approach to disposing of the docking manager to deal with some application crashing we are experiencing. However, i am getting an "object ref not set" error on the call to "this.dockingManager.Controls". The dockingmanager is not null, and i can call other methods to get info about it''s docked controls (GetAutoHideMode, ActiveControl, etc.). Any idea what could cause this? Error stack trace: System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="Syncfusion.Tools.Windows" StackTrace: at Syncfusion.Windows.Forms.Tools.DockingManager.GetControlsSequence(DockControllerBase controller, ArrayList controls) at Syncfusion.Windows.Forms.Tools.DockingManager.get_Controls() Dispose Code: IEnumerator ienum=this.dockingManager.Controls; ArrayList ctrls=new ArrayList(); while(ienum.MoveNext()) ctrls.Add(ienum.Current); foreach(Control ctrl in ctrls) { this.dockingManager.SetEnableDocking(ctrl,false); ctrl.Dispose(); } this.dockingManager.Dispose();

Julie Levy
Replied On July 12, 2006 10:06 PM UTC

I forgot to mention that i''m using the latest version and Visual Studio 2005 and my operating system is XP.

Mano J [Syncfusion]
Replied On July 13, 2006 10:57 AM UTC

Hi Julie, We regret for the inconvenience caused. This is a known issue with SetEnableDocking method in v. and it has been taken care of internally in our source. If you like to receive a Service pack containing this fix, please create a Direct-Trac incident with this forum link in the subject line. Please let me know if you have any questions. Thanks for using Essential Tools. Regards, Mano

Julie Levy
Replied On July 25, 2006 09:02 PM UTC

Hi -
Thanks for your response.
I will log an incident, but just wanted some clarification. The error i got was on this.dockingManager.Controls, not the call to the SetEnableDocking method. Are we talking about the same issue?

Joy K George [Syncfusion]
Replied On July 26, 2006 08:11 PM UTC

Hi Julie,

Could you please send us the full stack trace?
So that we could compare with the stack trace which produced here.


Julie Levy
Replied On July 27, 2006 06:58 PM UTC

The stack trace i posted in the first post is the most information i have.
The exception happens at:
ienum = dockingManager.Controls;

Julie Levy
Replied On July 27, 2006 11:56 PM UTC

I do have one more bit of info, not sure if it''s relevant.
This code is called in the Dispose method of a class which inherits from UserControl. The dockingmanager is on a user control, not a form.

Murugan [Syncfusion]
Replied On August 2, 2006 01:13 AM UTC

Hi Julie,

We regret for the inconvenience caused.

I was able to reproduce the issue here with our latest source is free from this issue. We are going to release our next patch on thursday.So could you please create a DirectTrac incident to obtain the patch release?

Murugan P.S

Julie Levy
Replied On August 9, 2006 08:39 PM UTC

Hi -
I got the patch, but still get the same exception, same call stack. It can happen if the dispose is called more than once. I wish it returned null instead of throwing the exception. I''ve re-written some code to avoid this, but wanted to let you know it''s still there.

Joy K George [Syncfusion]
Replied On August 10, 2006 11:02 PM UTC

Hi Julie,

We were able to reproduce the exception when we tried to call the dispose more than once.
You could resolve this issue by handling the exception using try catch method.
There is no need to excute dispose operation more than once.So you could eliminate the issue by handling exception since it will dispose the controls at the first time itself.


Julie Levy
Replied On August 11, 2006 06:02 PM UTC

Thanks, i''m already doing this. It just seemed wrong that DockingManager.Controls threw an exception when i could call the other methods on DockingManager to get information about controls (GetVisibility, GetAutoHideMode, etc.).

Joy K George [Syncfusion]
Replied On August 14, 2006 04:07 AM UTC

Hi Julie,

Yes ,You will get exceptions if the control is not docked at the time of calling such methods.For example if you call the method IsSameTabbedGroup() with arguements which are not in tabbed style you will get an exception.

You could handle that by using the usual method (try.. catch)which you are following now.

Please let us know , if you have any other queries.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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