RadWindow X RestrictionZone Problem

5 posts, 1 answers
  1. Christiano
    Christiano avatar
    9 posts
    Member since:
    May 2009

    Posted 28 Jul 2010 Link to this post

    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>

     

     

     

     

  2. Charles
    Charles avatar
    10 posts
    Member since:
    Jan 2009

    Posted 30 Jul 2010 Link to this post

    Think you need runat="server" in the restrictionzone div.
  3. Christiano
    Christiano avatar
    9 posts
    Member since:
    May 2009

    Posted 02 Aug 2010 Link to this post

    Sorry Charles, but "runat="server" in the restrictionzone div" don't work too.
  4. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 02 Aug 2010 Link to this post

    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
  5. Christiano
    Christiano avatar
    9 posts
    Member since:
    May 2009

    Posted 02 Aug 2010 Link to this post

    That's O.K now ! Thank you Georgi

Back to Top