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

RadWindow with a Height greater than Parent

1 Answer 32 Views
Window
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 22 Jun 2012, 09:15 PM
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?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 26 Jun 2012, 10:10 AM
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);
oWnd.moveTo(0,0);
//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.
Tags
Window
Asked by
Dan
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or