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

Maximized form in a MDI Frame

6 Answers 251 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Won
Top achievements
Rank 1
Won asked on 01 Oct 2010, 02:19 AM
I created a project that has a MDI frame and a form. I run it and open the form in the MDI frame. It looks fine if it is not maixmized. But once the form is maximized in the MDI frame, then there is a not usable gray color space on  the bottom and right side of the form. I placed a gridview and I maximized the form, then still there is a gray space on the bottom and left side. I see it only the form is maximized.

What is happening? 

Ver : Rad Control Winform Q3 2009 Sp1

6 Answers, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 01 Oct 2010, 09:15 AM
Hello Won,

Please try updating to the latest version of telerik Controls, Q2 2010 SP2,

I have created this test application in which i cannot find any problems with the layout if the grid or the child item (using RadForms, because i'm guessing the question was more about the layout of the form than the grid itself)

using Telerik.WinControls.UI;
using System.Windows.Forms;
 
public partial class Form1 : RadForm
{
    public Form1()
    {
        InitializeComponent();
        this.IsMdiContainer = true;
 
        CreateChildForm();
    }
 
    private void CreateChildForm()
    {
        var form = new ChildForm();
        form.MdiParent = this;
        form.TopLevel = false;
        form.ControlBox = true;
        form.FormBorderStyle = FormBorderStyle.Sizable;
        form.ShowInTaskbar = false;
        form.SizeGripStyle = SizeGripStyle.Show;
        form.Dock = DockStyle.None;
 
        var grid = new RadGridView();
        grid.Dock = DockStyle.Fill;
        form.Controls.Add(grid);
 
        form.Show();
    }
}

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
0
Won
Top achievements
Rank 1
answered on 01 Oct 2010, 04:05 PM
I have created the application with VB.Net, so I tested with another simple project as C# and VB both. That was working fine.
I don't know what is wrong with mine. I have to figure out why it happens by removing controls one by one then.
By the way, how do I update telerik control?
0
Emanuel Varga
Top achievements
Rank 1
answered on 01 Oct 2010, 04:12 PM
Hello Won,

In order to update telerik controls you just have to download the latest version from here (http://www.telerik.com/account/downloads.aspx), and after that there is a tool provided, called Project Update Utility from which all the references from all the projects in your selected folder will be updated to the latest version. After that if you are using some obsolete controls, like the ComboBox or ListBox Tabstrip and so on, there is a Conversion wizard which you can access by clicking on the smart tag of any control on the form (in the designer) and selecting Conversion Wizard.

From this, you can choose to convert some, or all of your controls. I have to warn you to be careful because although this changes the types of the controls to the new controls, it changes the name from the one you had to the default one, and all of the events, and everything will be removed.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
0
Won
Top achievements
Rank 1
answered on 01 Oct 2010, 04:43 PM
I found a reason  why it happened to my application. I created a form called "frmBaseTelerik" to inherit controls from this form.
I tested two forms in my MDI frame with an inherited form and a regular form. The gray color space is shown with inherited form.

This is only code that I added for  "frmBaseTelerik"

 Public Sub New()
        InitializeComponent()
        Me.MdiParent = frmMain
        Me.Dock = DockStyle.Fill
    End Sub

Should I not inherit form from  "frmBaseTelerik"? What is the reason that happens with inherited form?
0
Emanuel Varga
Top achievements
Rank 1
answered on 01 Oct 2010, 05:29 PM
Hello Won, I will do some tests as soon as possible, but at first glance it seems like a mdiParent issue. Will let you know as soon as possible. Best Regards, Emanuel Varga
0
Emanuel Varga
Top achievements
Rank 1
answered on 03 Oct 2010, 07:25 PM
Hello again Won,

I got a chance to test out this scenario and eveything works out great, and at a closer look at your code i saw there that you were setting the MdiParent from within the child, you don't have to do this, you will set the child form's parent when you are creating the form from the main form, like this:

MainForm:

Public Class Form1
    Inherits RadForm
 
 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.IsMdiContainer = True
 
        CreateChildForm()
    End Sub
 
    Private Sub CreateChildForm()
        Dim form = New RadChildForm()
        form.MdiParent = Me
        form.TopLevel = False
        form.ControlBox = True
        form.FormBorderStyle = FormBorderStyle.Sizable
        form.ShowInTaskbar = False
        form.SizeGripStyle = SizeGripStyle.Show
        form.Dock = DockStyle.None
 
        Dim grid = New RadGridView()
        grid.Dock = DockStyle.Fill
        form.Controls.Add(grid)
 
        form.Show()
    End Sub
End Class

RadBaseForm is empty for now, but you can add there your common application logic.
Public Class RadBaseForm
 
    Private Sub RadBaseForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 
    End Sub
End Class

RadChildForm:
Public Class RadChildForm
    Inherits RadBaseForm
 
     Private Sub RadChildForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 
    End Sub
End Class
Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Tags
GridView
Asked by
Won
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Won
Top achievements
Rank 1
Share this question
or