ToolTabStrip and redock

10 posts, 0 answers
  1. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 22 Jun 2015 Link to this post

    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

  2. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 23 Jun 2015 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 23 Jun 2015 in reply to Lou Link to this post

    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

  5. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 23 Jun 2015 in reply to Lou Link to this post

    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

  6. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 24 Jun 2015 Link to this post

    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
  7. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 24 Jun 2015 in reply to Dimitar Link to this post

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

     -Lou

  8. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 26 Jun 2015 Link to this post

    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
  9. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 26 Jun 2015 Link to this post

    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

  10. Hristo
    Admin
    Hristo avatar
    716 posts

    Posted 01 Jul 2015 Link to this post

    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
  11. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 01 Jul 2015 Link to this post

    OK - thanks for the explanation Hristo.

     -Lou

Back to Top
UI for WinForms is Visual Studio 2017 Ready