New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Size Limit

  • Demo Configurator
Set RadWindow's size properties

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

Note 1: There are default minimum width and height, determined by the icons in titlebar, etc and if we set less size, the visual appearance of the RadWindow is spoiled. That is why, if you set MinWidth or MinHeight less than them, the default absolute minimums will be set

Note 2: The AutoSize functionality respects the MaxWidth, MaxHeight, MinWidth and MinHeight properties.

Note 3: If you set Width(Height) bigger than the MaxWidth(MaxHeight) or less than MinWidth(MinHeight) you have set, the Width and Height properties will be modified in order to respect the set limits

Note 4: The client-side width and height setters respect the set limits

  • DefaultVB.aspx
  • DefaultVB.aspx.vb
  • scripts.js
  • styles.css
<%@ Page AutoEventWireup="true" CodeFile="DefaultVB.aspx.vb" Inherits="Telerik.Web.Examples.Window.MinMaxSize.DefaultVB"Language="vb"  %>

<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    <script src="scripts.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Button1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadWindow1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div id="window-container" class="demo-container">
        <telerik:RadWindow RenderMode="Lightweight" ID="RadWindow1" runat="server"
            VisibleOnPageLoad="true"
            OffsetElementID="window-container"
            NavigateUrl="https://www.bing.com"
            OnClientShow="telerikDemo.centerWindowInOffsetElement">
        </telerik:RadWindow>
    </div>
    <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1">
        <Views>
            <qsf:View>
                <qsf:ConfiguratorColumn runat="server" Title="Set RadWindow's size properties" Size="Wide">
                    <ul class="fb-group">
                        <li>
                            <qsf:NumericTextBox Label="Width (px)" MinValue="0" AllowOutOfRangeAutoCorrect="true" NumberFormat-DecimalDigits="0"
                                runat="server" Size="Narrow" ID="Width" MaxValue="1500">
                            </qsf:NumericTextBox>
                            <qsf:NumericTextBox Label="Height (px)" MinValue="0" AllowOutOfRangeAutoCorrect="true" NumberFormat-DecimalDigits="0"
                                runat="server" Size="Narrow" ID="Height" MaxValue="1500">
                            </qsf:NumericTextBox>
                        </li>
                        <li>
                            <qsf:NumericTextBox Label="MaxWidth (px)" Size="Narrow" MinValue="0" AllowOutOfRangeAutoCorrect="true" NumberFormat-DecimalDigits="0"
                                runat="server" ID="MaxWidth" MaxValue="1500">
                            </qsf:NumericTextBox>
                            <qsf:NumericTextBox Label="MaxHeight (px)" Size="Narrow" MinValue="0" AllowOutOfRangeAutoCorrect="true" NumberFormat-DecimalDigits="0"
                                runat="server" ID="MaxHeight" MaxValue="1500">
                            </qsf:NumericTextBox>
                        </li>
                        <li>
                            <qsf:NumericTextBox Label="MinWidth (px)" Size="Narrow" MinValue="0" AllowOutOfRangeAutoCorrect="true" NumberFormat-DecimalDigits="0"
                                runat="server" ID="MinWidth" MaxValue="1500">
                            </qsf:NumericTextBox>
                            <qsf:NumericTextBox Label="MinHeight (px)" Size="Narrow" MinValue="0" AllowOutOfRangeAutoCorrect="true" NumberFormat-DecimalDigits="0"
                                runat="server" ID="MinHeight" MaxValue="1500">
                            </qsf:NumericTextBox>
                        </li>
                        <li>
                            <qsf:Button ID="Button1" runat="server" Text="Apply Configuration" Width="180px" OnClick="ConfigureRadWindow" Size="Wide" />
                        </li>
                    </ul>
                </qsf:ConfiguratorColumn>
            </qsf:View>
        </Views>
    </qsf:ConfiguratorPanel>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance