New toolwindow docked in splitcontainer at runtime

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

    Posted 12 Mar 2015 Link to this post

    I have a scenario where I have a toolwindow docked on the left hand side of the document. I have a splitcontainer loaded just to the right of this. At runtime I am dynamically creating a new toolwindow and wish to position the new window at the top of the split containter, not the top of the document. I am using the following code to load the new toolwindow:

                    ToolWindow windowPT = new ToolWindow();

                    windowPT.Text = "PhoneTrak Dashboard";
                    windowPT.Name = "twPhoneTrak";
                    windowPT.DockState = DockState.Docked;

                    rdMain.DockWindow(windowPT, DockPosition.Top);

    Please see attached images for current placement vs. desired placement.

    Thanks in advance!
  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    1408 posts

    Posted 17 Mar 2015 Link to this post

    Hello Corey,

    Thank you for writing.

    To achieve the desired layout you should redock the first window:
    private void radButton1_Click(object sender, EventArgs e)
    {
        ToolWindow windowPT = new ToolWindow();
     
        windowPT.Text = "PhoneTrak Dashboard";
        windowPT.Name = "twPhoneTrak";
       
        radDock1.DockWindow(windowPT, DockPosition.Top);
        radDock1.DockWindow(toolWindow1, DockPosition.Left);
    }

    Let me know if you have additional questions.
     
    Regards,
    Dimitar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Boneshaker
    Boneshaker avatar
    5 posts
    Member since:
    Mar 2015

    Posted 17 Mar 2015 in reply to Dimitar Link to this post

    Wow -- that was easy - I never thought to re-dock the original toolwindow!  Thanks!
Back to Top