Arrange Child Windows in a MDI scenario

11 posts, 0 answers
  1. Hassan
    Hassan avatar
    152 posts
    Member since:
    Aug 2010

    Posted 08 Apr 2011 Link to this post

    Hi!
     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.
  2. sharon
    sharon avatar
    3 posts
    Member since:
    Mar 2016

    Posted 02 Mar 2016 Link to this post

    Is there an answer for this question?

    How do I arrange mdi forms in horizontal /vertical/ tile/ cascade? 

  3. Hristo
    Admin
    Hristo avatar
    1517 posts

    Posted 02 Mar 2016 Link to this post

    Hello Sharon,

    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:
    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  4. sharon
    sharon avatar
    3 posts
    Member since:
    Mar 2016

    Posted 06 Mar 2016 in reply to Hristo Link to this post

    Thanks .

    I tried this code  and it did not work…
    The forms are not arranged according the mdiLayout enumeration.


  5. Hristo
    Admin
    Hristo avatar
    1517 posts

    Posted 07 Mar 2016 Link to this post

    Hi Sharon,

    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
    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 Feedback Portal and vote to affect the priority of the items
  6. sharon
    sharon avatar
    3 posts
    Member since:
    Mar 2016

    Posted 10 Mar 2016 in reply to Hristo Link to this post

    Thanks for your reply!
    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.
  7. Hristo
    Admin
    Hristo avatar
    1517 posts

    Posted 10 Mar 2016 Link to this post

    Hi Sharon,

    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
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  8. Raj
    Raj avatar
    2 posts
    Member since:
    Jan 2020

    Posted 28 Jan in reply to Hristo Link to this post

    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

     

  9. Nadya
    Admin
    Nadya avatar
    301 posts

    Posted 29 Jan Link to this post

    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

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  10. Raj
    Raj avatar
    2 posts
    Member since:
    Jan 2020

    Posted 30 Jan in reply to Nadya Link to this post

    Thanks for the reply.

    Is there any another way to handle it.

  11. Nadya
    Admin
    Nadya avatar
    301 posts

    Posted 03 Feb Link to this post

    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

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top