RadDock's SplitContainer does not fill the Windows

799 views Asked by At

I have the following code to create RadDock programmatically:

public void CreateDock(Control parent)
{
    RadDock dock = new RadDock();            

    DocumentContainer docContainerLeft = new DocumentContainer();
    docContainerLeft.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Fill;
    DocumentTabStrip leftDocStrip = new DocumentTabStrip();
    DocumentWindow leftDoc = new DocumentWindow("Left");
    leftDocStrip.Controls.Add(leftDoc);
    docContainerLeft.Controls.Add(leftDocStrip);

    DocumentContainer docContainerRight = new DocumentContainer();
    docContainerRight.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Fill;
    DocumentTabStrip rightDocStrip = new DocumentTabStrip();
    DocumentWindow rightDoc = new DocumentWindow("Right");
    rightDocStrip.Controls.Add(rightDoc);
    docContainerRight.Controls.Add(rightDocStrip);

    RadSplitContainer middleSplitter = new RadSplitContainer(Orientation.Vertical);
    middleSplitter.Dock = DockStyle.Fill;
    middleSplitter.SizeInfo.SizeMode = SplitPanelSizeMode.Fill;
    middleSplitter.Controls.Add(docContainerLeft);
    middleSplitter.Controls.Add(docContainerRight);

    dock.Controls.Add(middleSplitter);

    ToolWindow transferWindow = new ToolWindow();
    transferWindow.Text = "Transfer Queue";
    transferWindow.DockState = DockState.Docked;
    dock.DockWindow(transferWindow, DockPosition.Bottom);

    dock.Dock = DockStyle.Fill;
    parent.Controls.Add(dock);
}

I'm trying to make the middleSplitter to fit the window. However there is always an unwanted area at the bottom. I have a picture of it here but SO does not allow me to post an image.

My question is: How to avoid the unwanted area and make the Splitter fill the window?

1

There are 1 answers

0
checho On

The DockWindow method of RadDock might be of help in this case. Here is how you can achieve the desired look: DocumentWindow middleDoc = new DocumentWindow("Middle"); dock.AddDocument(middleDoc);

        DocumentWindow leftDoc = new DocumentWindow("Left");
        dock.DockWindow(leftDoc, middleDoc, DockPosition.Top);

        DocumentWindow rightDoc = new DocumentWindow("Right");
        dock.DockWindow(rightDoc, leftDoc, DockPosition.Right);

        ToolWindow transferWindow = new ToolWindow();
        transferWindow.Text = "Transfer Queue";
        transferWindow.DockState = DockState.Docked;
        dock.DockWindow(transferWindow, DockPosition.Bottom);

More information and examples are available in the Telerik UI for WinForms documentation