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

RadDock DocWindow() method always puts Tab first, not last.

3 Answers 170 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Brook
Top achievements
Rank 1
Brook asked on 18 Jul 2011, 07:40 PM
Hello,

The following code always puts the new tabbed document at the beginning of the other tabbed documents in a TabStrip on my RadDock control:

radDock1.DockWindow(documentWindowMultiTabTest, DockPosition.Fill);

I need the document to open a new tab at the end of all the other tabs, not the beginning.

How can this be achieved?

By the way, when I try to accomplish this with the following code...

documentTabStrip1.Controls.Add(documentWindowMultiTabTest);

the tab does go to the end of the tabs, BUT if the user removes all tabs then adds 1 tab again to a blank RadDoc canvas, the following exception is thrown: "Changing Children collection of an already disposed element".


Thank you very much in advance,

Brook

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 19 Jul 2011, 08:50 AM
Hi Brook,

In order to insert the newly added DocumentWindow using the DockWindow method, you should change the DocumentInsertOrder to ToBack as described in this documentation article.

I hope this helps.

All the best,
Nikolay
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Brook
Top achievements
Rank 1
answered on 19 Jul 2011, 03:05 PM
Hi Nikolay,

Your recommendation worked perfectly!  Thank you very much!

When I initialize the user control, I added:

radDock1.DocumentManager.DocumentInsertOrder = DockWindowInsertOrder.ToBack;

Then, writing:

radDock1.DockWindow(documentWindowMultiTabTest, DockPosition.Fill);

Causes the new tab to go at the end of the tabs.  Furthermore, doing it this way instead of via:

documentTabStrip1.Controls.Add(documentWindowMultiTabTest);

stops the exception from occurring when the last tab is closed, and the user tries to add the first tab to the multi-tab control again.

Thanks again!

Brook
0
Nikolay
Telerik team
answered on 20 Jul 2011, 09:05 AM
Hi Brook,

Thank you for writing back.

I am glad to hear that you have found my answer helpful.

Generally speaking, adding a DocumentWindow through the Controls collection of a DocumentTabStrip is not the correct approach for adding a window, so you can safely continue using the DockWindow method, because this is a correct approach. You can also add a DocumentWindow using the AddDocument method as described in this article.

I hope this helps.

Best wishes,
Nikolay
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Dock
Asked by
Brook
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Brook
Top achievements
Rank 1
Share this question
or