RadWindow doesn't resize to its contents

4 posts, 0 answers
  1. Lance
    Lance avatar
    34 posts
    Member since:
    Sep 2007

    Posted 11 Feb 2011 Link to this post


    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.
  2. Miroslav Nedyalkov
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 16 Feb 2011 Link to this post

    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
  3. Bob
    Bob avatar
    1 posts
    Member since:
    Jul 2017

    Posted 20 Jul 2017 in reply to Miroslav Nedyalkov Link to this post

    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.


  4. Dinko
    Dinko avatar
    1114 posts

    Posted 25 Jul 2017 Link to this post

    Hi Bob,

    To clear the value you can use the ClearValue method of the window. 
    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.

    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.
Back to Top