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

RadWindow X RestrictionZone Problem

4 Answers 111 Views
Window
This is a migrated thread and some comments may be shown as answers.
Christiano
Top achievements
Rank 1
Christiano asked on 28 Jul 2010, 03:50 PM
Why this don't work? The set_width and set_height has Size Limitation in RestrictionZone?

I Use Assembly Telerik.Web.UI Version 2010.2.722.40

Anybody can help me?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="RadWindowXRestrictionZoneProblem.WebForm1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <style type="text/css">
        #RestrictionZone
        {
            position: absolute;
            width: 950px;            
            height: 550px;
            background-color: Gray;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div id="RestrictionZone">
        <input id="Button1" type="button" value="Open Window" onclick="javascript:OpenWindow('http://www.telerik.com','Telerik WebSite',600,400);" />
       
    <input id="Button2" type="button" value="Open Window (Erro Set Size Width Height)" onclick="javascript:OpenWindow('http://www.telerik.com','Telerik WebSite',650,450);" /></p>
  
    </div>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" RestrictionZoneID="RestrictionZone">
    </telerik:RadWindowManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type='text/javascript'>
  
            function OpenWindow(navigateUrl, title, width, height) {
  
                var oWnd = radopen(null, null);
                oWnd.setUrl(navigateUrl);
                oWnd.set_title(title);
                oWnd.set_width(width);
                oWnd.set_height(height);
                oWnd.center();
  
            
  
        </script>
    </telerik:RadCodeBlock>
    </form>
</body>
</html>

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Charles
Top achievements
Rank 1
answered on 30 Jul 2010, 10:32 PM
Think you need runat="server" in the restrictionzone div.
0
Christiano
Top achievements
Rank 1
answered on 02 Aug 2010, 11:57 AM
Sorry Charles, but "runat="server" in the restrictionzone div" don't work too.
0
Accepted
Georgi Tunev
Telerik team
answered on 02 Aug 2010, 12:17 PM
Hello guys,

The problem here is that when when shown, RadWindow is in position where setting its height to 450px will make the window overlap the restriction zone's border (RadWindow is resized from top to bottom and from left to right).
To avoid that problem I would suggest to initially move the window to position 0,0. This way it will be properly resized and at the end of your code you center it, so it will be positioned correctly after that as well.
e.g.
function OpenWindow(navigateUrl, title, width, height) {
 
    var oWnd = radopen(null, null);
    oWnd.moveTo(0,0);
    oWnd.setUrl(navigateUrl);
    oWnd.set_title(title);
    oWnd.set_width(width);
    oWnd.set_height(height);
    oWnd.center();
}



Regards,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Christiano
Top achievements
Rank 1
answered on 02 Aug 2010, 05:43 PM
That's O.K now ! Thank you Georgi

Tags
Window
Asked by
Christiano
Top achievements
Rank 1
Answers by
Charles
Top achievements
Rank 1
Christiano
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or