This is a migrated thread and some comments may be shown as answers.

Trying to use RadDock

1 Answer 164 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Sacha
Top achievements
Rank 1
Sacha asked on 08 May 2012, 04:16 PM
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?

1 Answer, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 11 May 2012, 01:58 PM
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.

Greetings,
Julian Benkov
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
Dock
Asked by
Sacha
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or