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

Creating User Controls that inherit from DocumentWindow

4 Answers 184 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eddie Jenkins
Top achievements
Rank 1
Eddie Jenkins asked on 17 May 2010, 09:57 PM
I am using the 2010.1.10.409 version of the Telerik.WinControls.UI assembly to utilize the new DocumentWindow and RadDock Manager.  I am creating a UserControl that inherits from DocumentWindow

using Telerik.WinControls.UI.Docking; 
 
public class myControl : DocumentWindow { } 

When I go into the design view to add controls I am only getting a blank gray screen.  Also when I updated my older user controls that inherited from DockPanel to now inherit from DocumentWindow, all of the controls that were on the form are now just listed in the gray screen, meaning that they are not showing the design and layout that the DockPanel originally gave me.

Is this a known issue?  Or is there something that I need to do to be able to have the design time support that the DockPanels had?

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 19 May 2010, 05:24 PM
Hi Eddie Jenkins,

In the new RadDock control we changed the way UserControls are handled. Now you do not need to derive your user control from DockWindow, it should derive from UserControl. After you design the user control accoring to your preferences, you need to load it in RadDock as it is shown below:

this.radDock1.DockControl(new myStandardControl(), Telerik.WinControls.UI.Docking.DockPosition.Left);

 

Regards,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Tim
Top achievements
Rank 1
answered on 19 May 2010, 06:44 PM
What happens if you want to set a DockPosition of Fill?  Currently I get an exception that states:

An unhandled exception of type 'System.ArgumentException' occurred in Telerik.WinControls.RadDock.dll

Additional information: Invalid DockTabStrip for a DockPosition.Fill operation.

So if i take your code and just add .Fill instead of .Left (or any other position) that is what I see.

Thank you again for the quick responses.

-Bill

0
Tim
Top achievements
Rank 1
answered on 19 May 2010, 07:21 PM
EDIT / UPDATE:
So I have found this documentation : http://www.telerik.com/help/winforms/dock_objectcreatedockingmanager.html and understand that a ToolWindow needs to dock to something (you can't just have it fill the RadDock).  I also understand that when you use the .DockControl() method, the control that you are docking is created as a ToolWindow.  So in trying to get past the fact that you cannot dock a ToolWindow to the RadDock, and that .DockControl() only creates ToolWindows, I stumbled upon the HostWindow Control.

instead of:

myUserControl c = new UserControl(); 
radDock1.DockControl(c, DockPosition.Fill); 

you can do this:

myUserControl c = new UserControl(); 
HostWindow host = new HostWindow(c,DockType.Document); 
radDock1.DockWindow(host, DockPosition.Fill); 
0
Nikolay
Telerik team
answered on 25 May 2010, 09:21 AM
Hello Bill,

Indeed, you can fill a RadDock with your window if the window is a HostWindow and the DockType of this window is Document. I am glad to hear that you managed to find the solution for your case.

Kind regards,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Eddie Jenkins
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Tim
Top achievements
Rank 1
Share this question
or