RadDock Form Designer

3 posts, 1 answers
  1. Troy Werner
    Troy Werner avatar
    2 posts
    Member since:
    Dec 2009

    Posted 30 Dec 2009 Link to this post

    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. Answer
    Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 06 Jan 2010 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Troy Werner
    Troy Werner avatar
    2 posts
    Member since:
    Dec 2009

    Posted 06 Jan 2010 Link to this post

    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
Back to Top