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

Document window is resizable

2 Answers 63 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Tino
Top achievements
Rank 1
Tino asked on 15 Nov 2017, 04:57 AM

I have RadForm-derived class that I'm adding as RadDock document windows. How do I make them stay the same size as the container? Please see attachment.

 

The code I'm using is something like this:

var view = new MyView(rule)
{
    Dock = DockStyle.Fill,
    TopLevel = false,
    FormBorderStyle = FormBorderStyle.None,
    MdiParent = this,
    Text = "blah",
};
 
view.Show();
var wnd = new DocumentWindow {Text = "blah"};
wnd.Controls.Add(view);
radDock1.AddDocument(wnd);

 

I'm using an older version of Telerik at the moment. The version of RadDock.dll is 2017.3.912.40 and Runtime version is v4.0.30319.

2 Answers, 1 is accepted

Sort by
0
Tino
Top achievements
Rank 1
answered on 15 Nov 2017, 05:23 AM

Just realized how wrong that code was, which I wrote early in the project.

This should work, from the docs. I just tried it and it's kind of there but still showing the border/resize grip, but probably because I changed lots of properties of my form when experimenting.

 

Configuring the Parent Form
 
C#VB.NET
private void Form1_Load(object sender, EventArgs e)
{
    this.IsMdiContainer = true;
    this.radDock1.AutoDetectMdiChildren = true;
}
3. Add a form to the project that will serve the role of child form. No properties, methods or event handlers need to be set for this form, except that you may want to add some content that will be visible when the child forms are displayed as tabbed documents.
 
4. Add code to the parent form to create the child form and assign it an MDI parent:
 
C#VB.NET
private void radMenuItem1_Click(object sender, EventArgs e)
{
    Form childForm = new Form();
    childForm.Text = "MDI Child " + DateTime.Now.ToShortTimeString();
    childForm.MdiParent = this;
    childForm.Show();
}
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Nov 2017, 10:11 AM
Hello, Tino,

Thank you for writing.  

I am glad that the problem you were facing is now resolved. Should you have further questions I would be glad to help.

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Dock
Asked by
Tino
Top achievements
Rank 1
Answers by
Tino
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or