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 / Behaviors

Set RadWindow's Behaviors:
 
Set specific behaviors


  • Using the Behaviors property of RadWindow

    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 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 );

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.Behaviors.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>
        <!-- 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>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div id="RestrictionZoneID" style="width: 500px; height: 400px; float: left;">
                </div>
                <div style="float: left">
                    <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Height="400" Title="Set RadWindow's Behaviors:"
                        Expanded="true">
                        <asp: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>
                        </asp:RadioButtonList>
                        <div>
                            &nbsp;</div>
                        <asp:Label ID="behaviorsLabel" runat="server">Set specific behaviors</asp:Label>
    <asp: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>
                        </asp:CheckBoxList>
                    </qsf:ConfiguratorPanel>
                </div>
                <telerik:RadWindow ID="RadWindow1" runat="server" Width="350" Height="350" RestrictionZoneID="RestrictionZoneID"
                    Behaviors="Default" VisibleOnPageLoad="true" NavigateUrl="http://www.telerik.com"
                    EnableShadow="true">
                </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