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

Dock with MdiChildren

2 Answers 142 Views
Dock
This is a migrated thread and some comments may be shown as answers.
JOSE MANUEL PÉREZ RAMÍREZ
Top achievements
Rank 1
JOSE MANUEL PÉREZ RAMÍREZ asked on 07 Jul 2009, 10:15 AM
i read help document and does not explain how i can use Mdichildre.
I have an application with new Q2 RadDock. (i migrate).
I create tabdocumentes
 IVVSA.Solicitudes.WinForms.VSolicitudLocales frmsolicitudlocales = new IVVSA.Solicitudes.WinForms.VSolicitudLocales(((vPrincipal)this.ParentForm).Credencial);
                        frmsolicitudlocales.MdiParent = this.ParentForm;
                        frmsolicitudlocales.Dock = DockStyle.Fill;
                        frmsolicitudlocales.Show();

forms created like HostWindow and is into radDock1.DockWindows.ToolWindows. 
Is possible set into radDock1.DockWindows.DocumentWindows?

if i have a button in form to close then not run. Close from Form not fires close from radDock.
how i do it?
I suggest about an example to do correctly these problem. Manage MdiForms in tabDocuments.


2 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 07 Jul 2009, 01:17 PM
Have you got the RadDock to AutoDetectMdiChildren?
If you have, then as long as you do the following:
Dim form as New FormName()
form.MdiParent = Me
form.Show

then it should show and close correctly.
Richard
0
Nikolay
Telerik team
answered on 07 Jul 2009, 01:40 PM
Hello JOSE MANUEL PÉREZ RAMÍREZ,

Thank you for the question.

The API for using RadDock in MDI scenario is pretty much the same as using the old DockingManager in MDI scenario. You should simply set the AutoDetectChildForm to true and RadDock will automatically host the MDI children.

Having a HostWindow with a child form in the ToolWindows, but not in the DocumentWindows is actually a result of a feature. When a HostWindow is created to host a child form, this HostWindow has a DockType ToolWindow. This allows you to float the document containing the child form and even you can dock it in a ToolTabStrip with other ToolWindows. If the DockType is DocumentWindow, you will not be able to perform these operations.

However, I agree that some of you, our users, may want to have the default DockType of a HostWindow in MDI scenario set to DocumentWindow. Therefore, in Q2 2009 SP1 we will make the DocumentWindow the default DockType and we will introduce a property which will switch between DocumentWindow and ToolWindow types for a HostWindow containing a child form.

As to the form closing issue, you are correct. When a child form is closed, the HostWindow that contains the form is not closed automatically. This issue will be addressed in Q2 2009 SP1 as well. For the time being you can subscribe to the FormClosed event of the form and close the parent HostWindow:
void form_FormClosed(object sender, FormClosedEventArgs e)  
{  
    this.radDock1.RemoveWindow((HostWindow)((Form)sender).Parent);  

Thank you for sharing your feedback with us. I am updating your Telerik points. 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.
Check out the tips for optimizing your support resource searches.
Tags
Dock
Asked by
JOSE MANUEL PÉREZ RAMÍREZ
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Nikolay
Telerik team
Share this question
or