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

User Interactions (Close, Resize, etc.)

  • Demo Configurator
Toggle Behaviors
Set specific behaviors

NEW: The RadWindow now supports LiveResize - if you resize/drag it, you will see that the IFRAME element is not being hidden while performing these operations. This functionality is turned on out of the box and it is not needed to put a special setting to enable it. This solves not only visual appearance problems but also funcionality ones, e.g restarting videos under FF, etc.

You can use the Behaviors property in our ASP.NET Modal Window to determine how the user can interact with the RadWindow object. Below are the Behaviors' enum values: 

  • Default - Default object behavior.
  • None - The user can perform none of the actions on the window. 
  • Resize - The user can resize the window by dragging its border. 
  • Minimize - The window can be minimized, and has a minimize button on the title bar.
  • Close - The user can close the window using a title bar button.
  • Pin - The window can be pinned, and has a pin button on the title bar.
  • Maximize - The window can be maximized, and has a maximize button on the title bar.
  • Move - The user can click on the window title bar and drag it to a new location.
  • Reload - The user can reload the window contents using a title bar button.

As an enum, Behaviors allows you to combine multiple values and easily achieve the desired result. You can set the enum on the client or in the server:

Examples:

ASPX

<telerik:RadWindow
 ID="RadWindow1"
 runat="server"
 Behaviors="Move, Close">
</telerik:RadWindow>

C#

RadWindow1.Behaviors = Telerik.Web.UI.WindowBehaviors.Move | Telerik.Web.UI.WindowBehaviors.Close;

VB.NET

RadWindow1.Behaviors = Telerik.Web.UI.WindowBehaviors.Move Or Telerik.Web.UI.WindowBehaviors.Close

JavaScript

oWnd.set_behaviors( Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close );

  • DefaultVB.aspx
  • DefaultVB.aspx.vb
  • styles.css
<%@ Page AutoEventWireup="true" CodeFile="DefaultVB.aspx.vb" Inherits="Telerik.Web.Examples.Window.Behaviors.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" />
</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="RadAjaxManager1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="BehaviorsRadioList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadWindow1" />
                    <telerik:AjaxUpdatedControl ControlID="BehaviorsCheckBoxList" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="BehaviorsCheckBoxList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadWindow1" />
                    <telerik:AjaxUpdatedControl ControlID="BehaviorsRadioList" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div id="RestrictionZoneID" class="demo-container size-narrow">
    </div>
    <telerik:RadWindow RenderMode="Lightweight" ID="RadWindow1" runat="server" Width="350" Height="350" RestrictionZoneID="RestrictionZoneID"
        Behaviors="Default" VisibleOnPageLoad="true" NavigateUrl="https://docs.telerik.com/kendo-ui/introduction"
        EnableShadow="true">
    </telerik:RadWindow>
    <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1">
        <Views>
            <qsf:View>
                <qsf:ConfiguratorColumn runat="server" Title="Toggle Behaviors" Size="Narrow">
                    <qsf:RadioButtonList ID="BehaviorsRadioList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="BehaviorsRadioList_SelectedIndexChanged">
                        <asp:ListItem Text="None" Value="None">
                        </asp:ListItem>
                        <asp:ListItem Text="Default (all on)" Value="Default">
                        </asp:ListItem>
                    </qsf:RadioButtonList>
                </qsf:ConfiguratorColumn>
                <qsf:ConfiguratorColumn runat="server" Title="Set specific behaviors" Size="Wide">
                    <qsf:CheckBoxList ID="BehaviorsCheckBoxList" runat="server" OnSelectedIndexChanged="BehaviorsCheckBoxList_SelectedIndexChanged"
                        AutoPostBack="True">
                        <asp:ListItem Text="Minimize" Value="Minimize">
                        </asp:ListItem>
                        <asp:ListItem Text="Close" Value="Close">
                        </asp:ListItem>
                        <asp:ListItem Text="Pin" Value="Pin">
                        </asp:ListItem>
                        <asp:ListItem Text="Maximize" Value="Maximize">
                        </asp:ListItem>
                        <asp:ListItem Text="Move" Value="Move">
                        </asp:ListItem>
                        <asp:ListItem Text="Resize" Value="Resize">
                        </asp:ListItem>
                        <asp:ListItem Text="Reload" Value="Reload">
                        </asp:ListItem>
                    </qsf:CheckBoxList>
                </qsf:ConfiguratorColumn>
            </qsf:View>
        </Views>
    </qsf:ConfiguratorPanel>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance