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

How to keep a window on the screen

3 Answers 97 Views
Window
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 05 May 2011, 09:18 PM
Hey guys

I'm new to telerik and I'm facing a big problem. I'm developping a web application and I need, when I click on a button, to make appears a new window (window B) inside the current window (windows A). So, I followed this demo http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/client-sideapi/fileselectordialog/defaultcs.aspx, but there's still a problem. The window B appears over the window A, but I can drag it "out" of the windows A and a scrollbar appears. So, I tried to put a RestrictionZoneID (using css) that will block the window B at the edge of the window A by using the current resolution of the screen, but I don't know how to find the resolution in css. Can someone help me ? In fact, the best would be that my window have the same behavior that any Microsoft window.

3 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 06 May 2011, 12:59 PM
Hello David,

I'm assuming window A is the browser window and not a RadWindow. If so, you can set the property KeepInScreenBounds="true" on your RadWindow (window B) to keep it within the visible viewing area.

I hope that helps.
0
David
Top achievements
Rank 1
answered on 06 May 2011, 02:16 PM
Thank you,

It works, but I still can move my window B out of the screen. It just when I stop holding my window that it go back in browser. It would be gret if it wasn't that I use silverlight and when I get the window B out of the screen, my silverlight app start lagging.
So, please, any other idea ?

David
0
Marin Bratanov
Telerik team
answered on 09 May 2011, 01:17 PM

Hello David,

This is the way browsers handle movable elements - they allow you to drag them outside of the screen or set their position to be outside of the screen through code. You can observe it with any movable element, not just RadWindow.

If you want the RadWindow to stay within a specified area you can use the RestrictionZone property as shown in the following Online Demo: http://demos.telerik.com/aspnet-ajax/window/examples/restrictionzone/defaultcs.aspx. Please note that you would need to have an html element to act as the zone that restricts the RadWindow, it cannot be done via CSS only.

Also note that the behavior of a Microsoft window is that it can also be dragged outside of the screen if it is not maximized or minimized. This is also true for the RadWindow.



Kind regards,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Window
Asked by
David
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
David
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or