This is a migrated thread and some comments may be shown as answers.

ToolTabStrip and redock

9 Answers 268 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Lou
Top achievements
Rank 1
Lou asked on 22 Jun 2015, 09:58 PM

How do I prevent a ToolTabStrip from being disposed when it has no child panels? I'd like to allow users to redock child panels into a ToolTabStrip even if there are no child panels left.

At the moment I am getting an error "Changing children collection of an already disposed element" when the redocking is attempted.

Thanks,

 

 -Lou

9 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 23 Jun 2015, 01:28 PM
Hello Lou,

Thank you for writing.

You should be able to dock the windows at any point. To dock them as DocumentWindows you should drop them in the middle of the Docking Assistant. Detailed information is available here: Arranging DockWindows. This is why I want to ask you to share the exact steps for this exception reproducing? This will allow us to properly investigate the case and provide you with a solution.

In addition could you specify which version of the suite you are using?

I am looking forward to your reply.

Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Lou
Top achievements
Rank 1
answered on 23 Jun 2015, 01:40 PM

Thanks for the reply Dimitar. I am using Q1 2015 (dll versions are 2015.1.331.20). The issue seems to be intermittent - if I can get a reproducible test case I will post it here.

 -Lou

0
Lou
Top achievements
Rank 1
answered on 23 Jun 2015, 02:38 PM

One way to reproduce this (occasionally) is as follows:

1. Create a docking layout in the designer that has a ToolTabStrip, for docking tool windows.

2. At run-time, dock 3 tool windows into this ToolTabStrip

3. Set docking for the 3 docked tool windows in the ToolTabStrip to "float"

4. Set docking for the 3 previously docked (then floated) tool windows to "hidden"

5. Wait a little while (a few minutes?)

6. Try to re-dock one of the the previously docked/floated/hidden tool windows into the ToolTabStrip

7. The ToolTabStrip.Collapsed property is set to false (as viewed using the debugger) and the attempt to re-dock the tool window in step 5 gives the exception "Changing children collection of an already disposed element" .

Unfortunately, the exception doesn't always happen. I repeated the above process 3 times and the exception happened once.

 -Lou

0
Dimitar
Telerik team
answered on 24 Jun 2015, 01:48 PM
Hello Lou,

Thank you for writing back.

In my opinion you are trying to dock an already disposed document window. By default when the windows are closed, they are disposed as well. Their CloseAction is set to CloseAndDispose by default. So in this case when you are hiding the windows they might get disposed and this is why the exception occurs. Could you please change their CloseAction to Hide and test if the issue still occurs? Detailed information about this property is available here: Removing ToolWindow and DocumentWindow at Runtime.

I am looking forward to your reply.
 
Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Lou
Top achievements
Rank 1
answered on 24 Jun 2015, 06:56 PM

Thanks for the reply Dimitar. The CloseAction is set to Hide on all of the ToolWindows in our application.

 -Lou

0
Dimitar
Telerik team
answered on 26 Jun 2015, 06:25 AM
Hi Lou,

Thank you for writing back.

I am not sure that I am testing this properly. This is why I have attached my test project. Could you please check it and let me know if you can reproduce the issue with it?

I am looking forward to your reply.

Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Lou
Top achievements
Rank 1
answered on 26 Jun 2015, 01:48 PM

Hi Dimitar, I have attached a sample project. The issue is related to saving and restoring the docklayout.

Your forum is only allowing me to attach files with extensions .gif, .jpg, .jpeg and .png. so I renamed my project (.zip file) with extension .png before trying to attach it. If this doesn't work then you'll need to help me figure out how to get the attachment to you.

Steps to reproduce with the sample project:

1. Make toolWindow2 floating

2. Click "Save Layout" to save the dock layout to XML

3. Click "Load Layout" to restore the layout

4. Click "Dock toolWindow2 in ToolTabStrip2"

You will get the exception "Changing children collection of an already disposed element" .

 -Lou

0
Hristo
Telerik team
answered on 01 Jul 2015, 01:19 PM
Hi Lou,

Thank you for writing.

The ToolTabStrip element is being disposed when you remove your ToolWindow from it and save the layout. This is the reason why you cannot access the same tab strip after loading the layout.

This element is created at runtime only when it is needed and you can perform this operation by dragging the tool window.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Lou
Top achievements
Rank 1
answered on 01 Jul 2015, 01:34 PM

OK - thanks for the explanation Hristo.

 -Lou

Tags
Dock
Asked by
Lou
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Lou
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or