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

4 posts, 0 answers
  1. Brook
    Brook avatar
    5 posts
    Member since:
    Aug 2012

    Posted 18 Jul 2011 Link to this post

    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
  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 19 Jul 2011 Link to this post

    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!

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Brook
    Brook avatar
    5 posts
    Member since:
    Aug 2012

    Posted 19 Jul 2011 Link to this post

    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
  5. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 20 Jul 2011 Link to this post

    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!

Back to Top