Deleting all tabs hides DocumentTabStrip

3 posts, 1 answers
  1. Chris
    Chris avatar
    5 posts
    Member since:
    Mar 2015

    Posted 14 Aug 2019 Link to this post

    Hi

    I have a DocumentTabStrip inside a RadDock. Initially it has one DocumentWindow and one tab. Dynamically I then add extra tabs depending on what they user does. This works.

    However, if I close all the tabs, the DocumentTabStrip disappears (documentTabStrip2.Controls.Count == 0 documentTabStrip2.Visible == false). If I add a new tab to the now empty DocumentTabStrip (documentTabStrip2.Controls.Count == 1) and set documentTabStrip2.Visible to true, it does not reappear.

    How can I close all the tabs on my DocumentTabStrip then add one back and make it appear again?
     
    Regards
    Chris

  2. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 14 Aug 2019 Link to this post

    Hello, Chris, 

    Indeed, all DocumentWindows are stored in a DocumentTabStrip. When the last window is closed, the DocumentTabStrip will be closed and disposed as well. This is expected behavior. Then, adding a new document will create a bran new DocumentTabStrip.

    RadDock has two different methods (CloseWindow and RemoveWindow) which you can call if you want to remove a ToolWindow/DocumentWindow. The result from these methods depends on the CloseAction property which can have one of these values:
    - Close: When a DockWindow has its CloseAction set to Close, this window is closed and detached (but not disposed) from its RadDock. You cannot manage it from RadDock collections anymore.
    - Hide: When a DockWindow has its CloseAction set to Hide, this window is only closed (hidden) in RadDock. However, this window is not detached from its RadDock and you can manage it from the RadDock collections.
    -CloseAndDispose: When a DockWindow has its CloseAction set to CloseAndDispose, this window is closed and then disposed.

    Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/controls/dock/object-model/removing-toolwindow-and-documentwindow-at-runtime

    It is recommended to manipulate the windows's visibility at run time by setting the CloseAction property to Hide for the desired DocumentWindow. Then, right click that window's tab and select Close. Then, call the Show method in order to bring back the window. RadDock will create a new DocumentTabStrip automatically. You can't bring back the already disposed DocumentTabStrip.

    You ca refer to the following help article demonstrating how to add a window in RadDock. Actually, it is not necessary to manage the DocumentTabStrips: https://docs.telerik.com/devtools/winforms/controls/dock/object-model/creating-toolwindow-and-documentwindow-at-runtime

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Chris
    Chris avatar
    5 posts
    Member since:
    Mar 2015

    Posted 14 Aug 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hi Dess

    Thanks for your reply. It was the second article that you linked to that provided me with the answers I needed.

    Regards

    Chris

Back to Top