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

Deleting all tabs hides DocumentTabStrip

2 Answers 222 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 14 Aug 2019, 12:08 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 14 Aug 2019, 01:09 PM
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.
0
Chris
Top achievements
Rank 1
answered on 14 Aug 2019, 01:56 PM

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

Tags
Dock
Asked by
Chris
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Chris
Top achievements
Rank 1
Share this question
or