How to programatically select a specific tab?

2 posts, 0 answers
  1. rjmorton
    rjmorton avatar
    17 posts
    Member since:
    Aug 2006

    Posted 24 Feb 2011 Link to this post

    Have been scratching my head a little over this one for a while, so I thought I would ask the question here on the forums!

    If I have a radDock that has for example 3 tabs/documents in the DocumentManager, how would I programatically select one of the tabs?

    I would have thought:
    this.radDock1.DocumentManager.ActiveDocument = radDock1.DockWindows[1];
    would be the way to go, but that property is read only.

    I can't find anything in the documentation for this and boy, I wish you guys would comment all the methods and prcedures in the radDock library, so intellisense would give me a clue!

    Thanks for the help,

    Richard.
  2. rjmorton
    rjmorton avatar
    17 posts
    Member since:
    Aug 2006

    Posted 24 Feb 2011 Link to this post

    Okay, as is always the case, 5 minutes after posting the question, I found the answer!

    Here's how to do it, just in case anyone else is stuck like I was:
    DockWindow[] docWindows = this.radDock1.DockWindows.GetWindows(DockState.TabbedDocument);
    this.radDock1.ActiveWindow = docWindows[0];

    I don't know if there's an easier way to do it (seems a little convoluted to me)?

    I found this answer in the samples app (Dock > Tabbed Document)
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top