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

RadDock Form Designer

2 Answers 138 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Troy Werner
Top achievements
Rank 1
Troy Werner asked on 30 Dec 2009, 03:25 PM

I am new to RadControls but so far they work fine.  I am not finding a reference that explains the prefered method for creating DocumentWindows for the RadDock Control using the Visual Studio form designer.  My program could have any number of forms and are based on different "types" that I define.  Before using RadDock, I would use the Visual Studio designer to create the basics for each type of form, then at run time dynamically add to and-or modify the base form for each instance required.  Because I don't know in advance what types of forms will be displayed, I don't think adding form types to the RadDock control itself at design time is a useful approach.  I found that if I use  AutoDetectMdiChildren, if a DocumentWindow form is "hidden" when the user closes it and I re-show the form later, it is blank.  To correct this I found the following works just fine. 
First don't user AuoDetectMdiChildren.
Second in the "formname.Designer.vb" file make the following change....

 

'Inherits System.Windows.Forms.Form

 

 

 

 

Inherits Telerik.WinControls.UI.Docking.DocumentWindow

 

 

If I later want to modify the form with the Visual Studio form designer, I un-comment the first line and comment the second.

This is working without a hitch, but since I don't find any reference that describes the "proper method", I just wanted to ask if this sounds OK or if there is a better "recommended" pratice that I should be following.  To summarize, I want to be able to visual modify DocumentWindow forms for the purpose of creating defined "types" of forms that my program can select from at runtime and the user needs the ability to hide and re-display these forms.

Thanks

Troy

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 06 Jan 2010, 02:23 PM
Hi Troy Werner,

Generally, you can continue using your approach since you find it applicable for your scenario.

However, the preferable and official approach concerns creating different Forms which will be hosted automatically in RadDock when AutoDetectMdiChildren is true. The forms will not be closed and disposed if you set the MdiChildrenDockType to ToolWindow (it is Document by default).

I am attaching a sample project where the approach is demonstrated. I hope this helps. If you have additional questions, feel free to contact me.

All the best,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Troy Werner
Top achievements
Rank 1
answered on 06 Jan 2010, 03:16 PM
Thank you,  That works perfectly and is much less hassle.  Even gives the user some new options about window placement, hadn't really considered that a Document Window can not float like a Tool Window can.

Troy
Tags
Dock
Asked by
Troy Werner
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Troy Werner
Top achievements
Rank 1
Share this question
or