I have a MDI Ribbon Form. I'm not using ribon merge. My child form open to different sizes. Client requires a single click Cascade sort operatin on all open child windows. How do I go about achieving this and also, is there a way to have a DropDownList control in the Ribbon to drop-list all open child windows?
Regards.
10 Answers, 1 is accepted
Is there an answer for this question?
How do I arrange mdi forms in horizontal /vertical/ tile/ cascade?
Thank you for writing.
You can call the Form.LayoutMdi method and arrange the layout according to the MdiLayout enumeration. Please check my code snippet below:
public
partial
class
RadForm1 : Telerik.WinControls.UI.RadForm
{
public
RadForm1()
{
InitializeComponent();
this
.IsMdiContainer =
true
;
RadForm form =
new
RadForm();
form.Text =
"MDI Child 1"
;
form.MdiParent =
this
;
form.Show();
form =
new
RadForm();
form.Text =
"MDI Child 2"
;
form.MdiParent =
this
;
form.Show();
form =
new
RadForm();
form.Text =
"MDI Child 3"
;
form.MdiParent =
this
;
form.Show();
}
protected
override
void
OnShown(EventArgs e)
{
base
.OnShown(e);
this
.LayoutMdi(System.Windows.Forms.MdiLayout.TileHorizontal);
}
}
A similar topic has also been discussed in the following forum threads:
- http://www.telerik.com/forums/mdi-form-with-rad-ribbon-form
- http://www.telerik.com/forums/radribbonform-in-radribbonform-mdi
I hope this helps. Should you have further questions please do not hesitate to write back.
Regards,
Hristo Merdjanov
Telerik
Thanks .
I tried this code and it did not work…
The forms are not arranged according the mdiLayout enumeration.
Thank you for writing back.
I am sending you attached a short video showing the result on my end. The LayoutMdi method is inherited in RadForm from the System.Windows.Forms namespace and it behaves the same if standard forms are used.
In case you keep experiencing this issue please send me a code snippet showing your local set up and additional information as to what behavior you expect.
I hope this helps. Should you have further questions please do not hesitate to write back.
Regards,
Hristo Merdjanov
Telerik
Here are more details on my problem:
I created new telerik project and copied the code you posted at 2.3.16 – this did not work on my computer.
I check the exe file on some more computers. surprisingly on some computers the exe worked as expected, and on some not.
I took the code you posted, and change the telerik radForm to regular windows form - this worked also on my computer.
Thank you for writing back.
I did not manage to reproduce the described behavior. Could you please open up a support ticket and send us a sample application with the code you are using and specify on what systems you can reproduce this behavior:
- type of Windows
- .NET version
Should you have further questions please do not hesitate to write back.
Regards,
Hristo Merdjanov
Telerik
Hi
I have used the Form.LayoutMdi method.
this.LayoutMdi(System.Windows.Forms.MdiLayout.TileHorizontal);
it is working fine for three forms. But when I used it for four forms. I got different layout.
e.g : I got the forms like this
1 2
3 4
excepted Result:
1
2
3
4
Hello Raj,
Following the provided information, I have tested the described scenario with the standard windows form and I observed the same behavior - the mdi child forms are not tiled horizontally when their count is bigger than three.
Since RadForm inherits from the System.Windows.Forms it is expected to behave in a similar way. I made some research in general programming forums. It seems that this issue regarding MdiLayout both TileHorizontal and TileVertical is already known. Please refer to the following threads which will be quite useful on this topic:
https://stackoverflow.com/questions/50691902/mdilayout-tilevertical-doesnt-work-correctly
https://stackoverflow.com/questions/53217815/how-can-i-control-the-display-order-of-child-forms-in-a-mdi-form
Feel free to use the suggested solutions there.
I hope this information helps. Should you have any other questions do not hesitate to ask.
Regards,
Nadya
Progress Telerik
Thanks for the reply.
Is there any another way to handle it.
Hello Raj,
Note that RadForm is not intended to handle this particular case in any specific manner. As I have already mentioned, RadForm inherits from the standard Windows Forms. This is why any working solution that is applicable to standard Windows Form is relevant to RadForm as well.
Note that this is more like a general programming question and it is not directly related to RadForm. Feel free to search in the relevant forums if you have any further questions on this topic.
Should you have further questions regarding RadControls from the Telerik UI for WinForms suite please let me know.
Regards,
Nadya
Progress Telerik
If you add a RadDock control to the code above (shared by Hristo) the layoutmdi doesn't work anymore...
How can I make it work MDI with tabs? (same code above with raddock control) ?
You have posted the same question in different forum thread. Let's continue there to avoid duplication.