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

PanelBar / Expand Animation

Configuration
Expand Animation
Collapse Animation

  • You can customize the way the panel-items expand and collapse.

    The ExpandAnimation and CollapseAnimation tags of RadPanelBar are used to customize the way groups are expanded and collapsed. For each expand or collapse animation, you can specify Type and Duration:

    • The Type is chosen from a list of predefined animation effects.
    • The Duration is set in milliseconds.

    To disable expand animation effects, set the Type to AnimationType.None.

    The ExpandDelay and CollapseDelay properties set the period of time (in milliseconds) between clicking the item and the children starting to expand or collapse respectively.

        <telerik:RadPanelBar ID="RadPanelBar1" runat="server"/>
            <ExpandAnimation Type="OutQuart" Duration="300" />
            <CollapseAnimation Type="OutQuint" Duration="200" />
            ...
        </telerik:RadPanelBar>
    

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>

    <%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="true" Inherits="Telerik.Web.Examples.PanelBar.Functionality.ExpandAnimation.DefaultCS" %>

    <!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 ID="Headtag1" runat="server"></qsf:HeadTag>
        <style type="text/css">
            dt
            {
                float:left;
                text-align: right;
                width:110px;
                padding-right: 10px;
            }
            
            dt, dl { padding-top: 4px; }
            
            dl { margin: 0; }
            
            .cfgVertical .title { padding-top: 10px; }
            
            dl input, dl select {margin-top: 2px; border: 1px solid #C8E5F2; }
        </style>
    </head>
    <body class="BODY">
        <form id="mainForm" method="post" runat="server">
            <telerik:RadScriptManager ID="ScriptManager" runat="server" />
            <qsf:Header ID="Header1" runat="server" NavigationLanguage="C#"></qsf:Header>
            <div style="width: 300px; float: left; margin-right: 20px;">
                <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Height="300px"
                    ExpandMode="FullExpandedItem">
                    <Items>
                        <telerik:RadPanelItem Expanded="True" Text="ASP.NET controls">
                            <Items>
                                <telerik:RadPanelItem Text="RadMenu">
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="RadTabStrip">
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="RadPanelBar">
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="RadpanelBar">
                                </telerik:RadPanelItem>
                            </Items>
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem Text="WinForms controls">
                            <Items>
                                <telerik:RadPanelItem Text="RadMenustrip">
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="RadTabStrip">
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="RadToolStrip">
                                </telerik:RadPanelItem>
                            </Items>
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem Text="Other projects">
                            <Items>
                                <telerik:RadPanelItem Text="SiteFinity">
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="Reporting">
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="RadAjax">
                                </telerik:RadPanelItem>
                            </Items>
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelBar>
            </div>
            <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Title="Configuration" Orientation="Vertical" Expanded="true" >
                <div style="height: 150px">
                 <div class="title">Expand Animation</div>
                 <dl>
                     <dt><asp:Label runat="server" AssociatedControlID="ddlExpandType">Type</asp:Label></dt>
                     <dd>
                         <asp:DropDownList ID="ddlExpandType" runat="server" Style="width: 103px;"></asp:DropDownList>
                     </dd>
                        
                     <dt><asp:Label ID="Label1" runat="server" AssociatedControlID="editExpandDuration">Duration</asp:Label></dt>
                     <dd>
                         <asp:TextBox ID="editExpandDuration" runat="server" Style="width: 100px;">200</asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="editExpandDuration"
    ErrorMessage="positive integer required" Display="Dynamic">

                         </asp:RequiredFieldValidator>
    <asp:RangeValidator ID="RangeValidator1" ControlToValidate="editExpandDuration" runat="server"
    MinimumValue="0" MaximumValue="3000" Type="Integer" ErrorMessage="valid range: 0-3000"
    Display="Dynamic">

                         </asp:RangeValidator>
                     </dd>
                 </dl>
                    
                 <div class="title">Collapse Animation</div>
                 <dl>
                     <dt><asp:Label runat="server" AssociatedControlID="ddlCollapseType">Type</asp:Label></dt>
                     <dd>
                         <asp:DropDownList ID="ddlCollapseType" runat="server" Style="width: 103px;"></asp:DropDownList>
                     </dd>
                     <dt><asp:Label runat="server" AssociatedControlID="editCollapseDuration">Duration</asp:Label></dt>
                     <dd>
                         <asp:TextBox ID="editCollapseDuration" runat="server" Style="width: 100px;">200</asp:TextBox>
    <asp:RequiredFieldValidator runat="server" ControlToValidate="editCollapseDuration"
    ErrorMessage="positive integer required" Display="Dynamic" ID="Requiredfieldvalidator2">

                         </asp:RequiredFieldValidator>
    <asp:RangeValidator ControlToValidate="editCollapseDuration" runat="server" MinimumValue="0"
    MaximumValue="3000" Type="Integer" ErrorMessage="positive integer required" Display="Dynamic"
    ID="Rangevalidator2">

                         </asp:RangeValidator>
                     </dd>
                 </dl>
                    
                 <asp:Button OnClientClick="return applyChanges()" ID="btnApplyChanges" runat="server" Text="Apply" CssClass="button" style="float: right; margin-top: 10px;"></asp:Button>
                </div>
            </qsf:ConfiguratorPanel>

            <script type="text/javascript">
                function applyChanges()
                {
                    var panelBar = $find("RadPanelBar1");
                    var expandAnimationTypeDropDown = $get("ddlExpandType");
                    
                    var expandAnimationType =
                        Telerik.Web.UI.AnimationType.parse(expandAnimationTypeDropDown.value);
                    
                    panelBar.get_expandAnimation().set_type(expandAnimationType);
                    var expandDurationTextBox = $get("editExpandDuration");
                    var expandDuration = parseInt(expandDurationTextBox.value);
                    
                    panelBar.get_expandAnimation().set_duration(expandDuration);
                    
                    var collapseAnimationTypeDropDown = $get("ddlCollapseType");
                    
                    var collapseAnimationType =
                        Telerik.Web.UI.AnimationType.parse(collapseAnimationTypeDropDown.value);
                    
                    panelBar.get_collapseAnimation().set_type(collapseAnimationType);
                    var collapseDurationTextBox = $get("editCollapseDuration");
                    var collapseDuration = parseInt(collapseDurationTextBox.value);
                    
                    panelBar.get_collapseAnimation().set_duration(collapseDuration);
                    
                    return false;
                }
            </script>

            <qsf:Footer ID="Footer1" runat="server"></qsf:Footer>
        </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