Rad window can be dragged/Opened outside of screen bounderies

2.6k Views Asked by At

I have two issues with rad window:

  1. Is it possible to prevent rad window from being dragged outside of the screen boundaries?I tried using KeepInScreenBounds property, but it didn't help.

Here is my code example, and screen shot is attached:

<telerik:RadWindowManager ID="rwm" runat="server" ShowContentDuringLoad="false" Behaviors="Close,Move" VisibleStatusbar="false" Skin="Gray" Modal="true" KeepInScreenBounds = "true">

<Windows>

<telerik:RadWindow ID="rwAuditCredentials" runat="server" NavigateUrl="~/Pages/Audits/AuditCredentials.aspx" Title="Audit Credentials" Height="230px" Width="360px" KeepInScreenBounds="true">  

</telerik:RadWindow>

</Windows>

</telerik:RadWindowManager>
  1. How can I prevent from radwindow from being opened outside of the screen bounderies? I got my radwindow opened when the title bar is outside the screen bounderies (as it looks in my print screen) and I couldn't drag it or close it.

Thanks!

2

There are 2 best solutions below

0
David Bell On

I can't see the screenshot so I'm assuming you've had the same issue we have in that if the RadWindow is dragged to the bounds of a window then it automatically starts to scroll and you can leave it of the edge of your window.

We got round this same problem by using the Restriction Zone property.

The examples show it used in tables dedicated to a section of the page used purely for windows but if you're using it as a modal popup you can set it to the id of your main page div.

e.g.

<div id="zone1">
    <p>Other page content as required</p>
</div>

<telerik:RadWindowManager ID="rwm" runat="server" ShowContentDuringLoad="false" Behaviors="Close,Move" VisibleStatusbar="false" Skin="Gray" Modal="true" KeepInScreenBounds = "true" RestrictionZoneID="zone1">
<Windows>
<telerik:RadWindow ID="rwAuditCredentials" runat="server" NavigateUrl="~/Pages/Audits/AuditCredentials.aspx" Title="Audit Credentials" Height="230px" Width="360px" KeepInScreenBounds="true">  
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
1
John Andrews On

Thanks, David! (3 years belated). Your solution worked for me, with a mix of both modal and non-modal windows, shown in code ...

    <body>
        <form id="form2" runat="server">
            <telerik:RadSplitter runat="server" ID="RadSplitter1" BorderStyle="None" PanesBorderSize="0">
                <telerik:RadPane ID="RadPane1" runat="server">
                    <div id="ContentPane">
                        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" >
                        </asp:ContentPlaceHolder>
                        <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server" >
                        </asp:ContentPlaceHolder>
                        <asp:ContentPlaceHolder ID="ContentPlaceHolder3" runat="server" >
                        </asp:ContentPlaceHolder>
                    </div>
                </telerik:RadPane>
            </telerik:RadSplitter>
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" Style="z-index: 12345" KeepInScreenBounds="true" RestrictionZoneID="ContentPane">
                <Windows>
                    <telerik:RadWindow ID="RadWindow1" runat="server" Title="Login" Height="250px"
                        Width="300px" Left="200px" ReloadOnShow="true" ShowContentDuringLoad="false" VisibleStatusbar="false" 
                        Modal="true" Behaviors="Move, Close">
                    </telerik:RadWindow>
                    <telerik:RadWindow ID="RadWindow2" runat="server" Title="Copy Asset" Height="250px" 
                        Width="400px" Left="200px" ReloadOnShow="true" ShowContentDuringLoad="false" VisibleStatusbar="false" 
                        Modal="true" Behaviors="Move, Close">
                    </telerik:RadWindow>
                    <telerik:RadWindow ID="RadWindow3" runat="server" Title="Create Asset" Height="650px" Top="50px"
                        Width="800px" Left="125px" ReloadOnShow="true" ShowContentDuringLoad="false" VisibleStatusbar="false"  
                        Modal="true" Behaviors="Move, Resize, Close">
                    </telerik:RadWindow>
                    <telerik:RadWindow ID="RadWindow4" runat="server" Title="View/Edit Connections" Height="800px"
                        Width="800px" Left="50px" ReloadOnShow="true" ShowContentDuringLoad="false" 
                        Modal="false" Behaviors="Move, Resize, Close, Maximize, Minimize">
                    </telerik:RadWindow>
                    <telerik:RadWindow ID="RadWindow5" runat="server" Title="Make Connections" Height="750px"
                        Width="1150px" Left="100px" Top="75px" ReloadOnShow="true" ShowContentDuringLoad="false" 
                        Modal="false" Behaviors="Move, Resize, Close">
                    </telerik:RadWindow>
                    <telerik:RadWindow ID="RadWindow6" runat="server" Title="User Doc" Height="750px"
                        Width="1150px" Left="100px" Top="25px" ReloadOnShow="false" ShowContentDuringLoad="true" 
                        Modal="true" Behaviors="Move, Resize, Close" NavigateUrl="~/Doc/CoreConnect.pdf">
                    </telerik:RadWindow>
                    <telerik:RadWindow ID="RadWindow7" runat="server" Title="About" Height="300px"
                        Width="500px" Left="100px" Top="100px" ReloadOnShow="false" ShowContentDuringLoad="true" 
                        Modal="true" Behaviors="Move, Resize, Close" VisibleStatusbar="false"  >
                    </telerik:RadWindow>
                </Windows>
            </telerik:RadWindowManager>
        </form>
    </body>