Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Window / Limiting the size

Set RadWindow's size properties:
  • Width (px)
  • Height (px)
  • MaxWidth (px)
  • MaxHeight (px)
  • MinWidth (px)
  • MinHeight (px)


  • The RadWindow now supports MaxWidth, MaxHeight, MinWidth and MinHeight properties - if they are set, when you resize it they will be respected

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.Window.MinMaxSize.DefaultCS"
        Language="c#" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag runat="server" ID="Headtag1"></qsf:HeadTag>
        <link href="styles.css" rel="stylesheet" type="text/css" />
        <!-- custom head section -->
        <!-- end of custom head section -->
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" />
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadFormDecorator ID="formDecorator" runat="server" DecorationZoneID="UpdatePanel1" />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div style="margin-left:500px;">
                    <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Height="400" Title="Set RadWindow's size properties:"
                        Expanded="true">
                        <ul class="config">
                            <li><span class="title">Width (px)</span>
                                <telerik:RadNumericTextBox MinValue="0" AllowOutOfRangeAutoCorrect="true" NumberFormat-DecimalDigits="0"
                                    runat="server" ID="Width" EnabledStyle-HorizontalAlign="Right" Width="150" /></li>
                            <li><span class="title">Height (px)</span>
                                <telerik:RadNumericTextBox MinValue="0" AllowOutOfRangeAutoCorrect="true" NumberFormat-DecimalDigits="0"
                                    runat="server" ID="Height" EnabledStyle-HorizontalAlign="Right" Width="150" /></li>
                            <li><span class="title">MaxWidth (px)</span>
                                <telerik:RadNumericTextBox MinValue="0" AllowOutOfRangeAutoCorrect="true" NumberFormat-DecimalDigits="0"
                                    runat="server" ID="MaxWidth" EnabledStyle-HorizontalAlign="Right" Width="150" /></li>
                            <li><span class="title">MaxHeight (px)</span>
                                <telerik:RadNumericTextBox MinValue="0" AllowOutOfRangeAutoCorrect="true" NumberFormat-DecimalDigits="0"
                                    runat="server" ID="MaxHeight" EnabledStyle-HorizontalAlign="Right" Width="150" /></li>
                            <li><span class="title">MinWidth (px)</span>
                                <telerik:RadNumericTextBox MinValue="0" AllowOutOfRangeAutoCorrect="true" NumberFormat-DecimalDigits="0"
                                    runat="server" ID="MinWidth" EnabledStyle-HorizontalAlign="Right" Width="150" /></li>
                            <li><span class="title">MinHeight (px)</span>
                                <telerik:RadNumericTextBox MinValue="0" AllowOutOfRangeAutoCorrect="true" NumberFormat-DecimalDigits="0"
                                    runat="server" ID="MinHeight" EnabledStyle-HorizontalAlign="Right" Width="150" /></li>
                        </ul>
    <asp:Button ID="Button1" runat="server" Text="Configure RadWindow" Width="150px"
    CssClass="btnCss" OnClick="ConfigureRadWindow" />

                    </qsf:ConfiguratorPanel>
                </div>
                <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Default" VisibleOnPageLoad="true"
                    NavigateUrl="http://www.telerik.com" Left="260" Top="220" style="z-index:31000" OffsetElementID="mainForm">
                </telerik:RadWindow>
            </ContentTemplate>
        </asp:UpdatePanel>
        <p>
        </p>
        <qsf:Footer runat="server" ID="Footer1" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451