Trying to use RadDock

2 posts, 0 answers
  1. Sacha
    Sacha avatar
    10 posts
    Member since:
    May 2012

    Posted 08 May 2012 Link to this post

    Hi guys,

    I'm having a little trouble trying to get the RadDock working.

    Here is my scenario:
    I have a windows form which contains a RadPageView. Inside one of those tabs I have multiple RadSplitContainers which are giving me left, center, right and bottom panels. The left, right and bottom ones are fixed with the center expanding with the form/window. In each of these I need to house UserControls or Forms.

    But how?

    I've dropped a RadDock into a panel and set it to fill the parent. I've then created both a UserControl and a Form which at run time (Form1_Load) either one gets inserted into the RadDock. Something like this (ucBBMain is my UserControl):

    UserControl uc = new ucBBMain();
    radDock1.DockControl(uc, DockPosition.Fill);

    But I get an  error:
    "Invalid DockTabStrip for a DockPosition.Fill operation."

    I also tried this but get the same error:
    UserControl uc = new ucBBMain();
    HostWindow host = new HostWindow(uc, DockType.Document);
    radDock1.DockControl(host, DockPosition.Fill);

    Very same happens with a Form.

    So how can I put UserControls or Forms into a RadDock where their size is expanded to the RadDock they are inside?

    Or in fact is a RadDock the correct control to use? Can I put a UserControl directly into the SplitContainer panels?
  2. Julian Benkov
    Julian Benkov avatar
    1135 posts

    Posted 11 May 2012 Link to this post

    Hello Sacha,

    To dock a control with DockPosition.Fill in RadDock control you must specify the type of the new window as a Document. Here is a sample example:
    protected override void OnButton3Click()
        Form form = new Form();
        radDock.DockControl(form, DockPosition.Fill, DockType.Document);

    I hope this helps. Let us know if you have any other questions.

    Julian Benkov
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top