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

RadWindow doesn't resize to its contents

3 Answers 123 Views
Window
This is a migrated thread and some comments may be shown as answers.
Lance
Top achievements
Rank 1
Lance asked on 11 Feb 2011, 07:32 AM
Hi,

I've got a public static RadWindow that I use globally throughout my application.  I have several usercontrols of varying sizes that I load via this RadWindow by setting them to be the RadWindow's content and then running the RadWindow's ShowDialog method.  The RadWindow seems to have a maximum width and height that I didn't set, which has the effect of cutting off parts of my larger controls.  If I use the Microsoft ChildWindow it resizes correctly so I assume its a problem with RadWindow and not my controls.  I am using the internal build 2010.3.1331.   Is this a bug? 

If I resize the window for the larger controls it stays large when the smaller controls are the RadWindow's content.

Please advise.

3 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 16 Feb 2011, 05:50 PM
Hello Tim,

 Currently if you don't set Width and Height to the RadWindow control it tries to auto-size to its content, but as we don't want to measure with infinite size (because this will break the virtualized controls) we decided to measure it with some size relative to the size of the Silverlight plugin - 0.75 of its width and height. This acts like MaxWidth/Height. To overcome this you may set MaxWidth and MaxHeight to the RadWindow control to some big value like 10000 and this will measure it with this size.

About the other problem - if you are using the same window instance it is normal for it to keep the size the user picked up by resizing - resizing changes the Width and Height of the RadWindow control. What I would suggest you for this case is to clear the Width and Height before showing new content in the Window.

If you have further questions, don't hesitate to ask!

Kind regards,
Miroslav Nedyalkov
the Telerik team
0
Bob
Top achievements
Rank 1
answered on 20 Jul 2017, 06:37 PM

In the reply you said "I would suggest you for this case is to clear the Width and Height before showing new content in the Window" how would you clear the width and height? Because I notice RadWindow seems to remember the settings of prior windows, unless you specifically set that parameter on the new dialog.

Thank you in advance.

Bob

0
Dinko
Telerik team
answered on 25 Jul 2017, 03:09 PM
Hi Bob,

To clear the value you can use the ClearValue method of the window. 
radwindow.ClearValue(RadWindow.WidthProperty);
radwindow.ClearValue(RadWindow.HeightProperty);
 
Or you can set it to double.NaN.
window.Width = double.NaN;
window.Height = double.NaN;

Give this approach a try and let me know if they work for you.

Regards,
Dinko
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Window
Asked by
Lance
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Bob
Top achievements
Rank 1
Dinko
Telerik team
Share this question
or