RadWindow with a Height greater than Parent

2 posts, 0 answers
  1. Dan
    Dan avatar
    139 posts
    Member since:
    Feb 2011

    Posted 22 Jun 2012 Link to this post

    I can't seem to find anywhere that this is explained - here is what I am looking to do:

    I have a RadWindowManager on my Page
    I want to call a RadWindow that may have a large grid in it
    The RadWindow is set to AutoSize and if the Grid is longer than the parent browser window, I would like:
    1. The RadWindow to show it's full height, without scrollbars
    2. The Parent window would now scroll up and down to allow you to see the entire RadWindow content

    Is this possible?
  2. Marin Bratanov
    Marin Bratanov avatar
    5709 posts

    Posted 26 Jun 2012 Link to this post

    Hi Dan,

    The AutoSize functionality is designed so that it keeps the entire RadWindow visible. If the content is larger than the available space the RadWindow itself will have scrollbars. This behavior is intentional so that parts of the popup are not hidden automatically, which would be percieved as buggy behavior by the end user.

    What you can do is to use the RadWIndow's client-side API and set its size according to your needs (e.g. by obtaining the dimensions of your content via JavaScript) and then moving it so that its titlebar is at the topmost position. e.g.:
    oWnd.setSize(myWidth, myHeight);
    //the first parameter is the horizontal position, you can keep it centered like this:
    oWnd.setSize(myWidth, myHeight);
    oWnd.center();//centers the RadWindow so that this calculates the x-position for you
    oWnd.moveTo(oWnd.getWindowBounds().x, 0);//you can change the 0 to some offset from the top of the browser

    How to determine if you need to executet his logic (i.e. what is the size threshold) depends on your custom logic and needs.

    Kind regards,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top