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

ComboBox / Animation

Example Configuration
Expand Animation
Type
select
Duration
Collapse Animation
Type
select
Duration
select

  • Use the configuration panel to explore the different types of animations.

Source Code

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

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ 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" %>
    <%@ 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 ID="Headtag1" runat="server" />
        <style type="text/css">
            dl
            {
             margin: 0 0 15px 0;
             padding: 5px 0 0 0;
            }
            dt
            {
                float: left;
                width: 80px;
                text-align: right;
                padding: 6px 5px 0 0;
            }
            dt, dd
            {
                padding-bottom: 6px;
            }
            
            .title
            {
                font-weight: bold;
                padding: 0 0 3px 10px;
            }
            
            .panel1, .panel2
            {
                width: 220px;
                float: left;
                clear: left;
            }
            
            .combobox-panel
            {
                width: 400px;
                float: left;
                height: 100px;
                padding: 100px 0;
                /*background: transparent url('Img/module.png') no-repeat 0 0;*/
                text-align:center;
            }
            
            .qsfConfig
            {
             padding: 20px 0 0 0;
            }
            
            .submit-panel
            {
                text-align: left;
                padding-left: 85px;
            }
            
        </style>
    </head>
    <body class="BODY">
        <form id="mainForm" method="post" runat="server">
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
            <qsf:Header ID="Header1" runat="server" NavigationLanguage="C#" />
            <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all" ControlsToSkip="Scrollbars"></telerik:RadFormDecorator>
            <qsf:ConfiguratorPanel Orientation="Vertical" runat="server" ID="ConfigurationPanel1" Expanded="True">
                <div class="panel1">
                    <div class="title">
                        Expand Animation</div>
                    <dl>
                        <dt>Type</dt>
                        <dd>
                            <telerik:RadComboBox ID="ddlExpandType" runat="server" Width="120px" Height="300px"/>
                        </dd>
                        <dt>Duration</dt>
                        <dd>
                            <telerik:RadNumericTextBox ID="editExpandDuration" runat="server" Width="120px" IncrementSettings-Step="100"
                                MinValue="0" MaxValue="3000" NumberFormat-DecimalDigits="0" ShowSpinButtons="true" />
                        </dd>
                    </dl>
                </div>
                <div class="panel2">
                    <div class="title">
                        Collapse Animation</div>
                    <dl>
                        <dt>Type</dt>
                        <dd>
                            <telerik:RadComboBox ID="ddlCollapseType" runat="server" Width="120px" Height="300px"/>
                        </dd>
                        <dt>Duration</dt>
                        <dd>
                            <telerik:RadNumericTextBox ID="editCollapseDuration" runat="server" Width="120px"
                                IncrementSettings-Step="100" MinValue="0" MaxValue="3000" NumberFormat-DecimalDigits="0" ShowSpinButtons="true" />
                        </dd>
                    </dl>
                </div>
                <div class="submit-panel">
                 <asp:Button ID="btnApplyChanges" runat="server" Text="Apply" OnClientClick="return applyChanges()" />
                </div>
            </qsf:ConfiguratorPanel>
            <div class="combobox-panel">
                <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="150px">
                    <ExpandAnimation Type="OutQuart" Duration="300" />
                    <CollapseAnimation Type="OutQuint" Duration="200" />
                    <Items>
                        <telerik:RadComboBoxItem Text="Apple" />
                        <telerik:RadComboBoxItem Text="Banana" />
                        <telerik:RadComboBoxItem Text="Lemon" />
                        <telerik:RadComboBoxItem Text="Orange" />
                        <telerik:RadComboBoxItem Text="Strawberry" />
                        <telerik:RadComboBoxItem Text="Water melon" />
                    </Items>
                </telerik:RadComboBox>
            </div>

            <script type="text/javascript">
                function applyChanges()
                {
                    var combo = $find("<%= RadComboBox1.ClientID %>");
                    
                    //set the expand animation
                    var expandAnimationTypeDropDown = $find("<%= ddlExpandType.ClientID %>");                
                    var expandAnimationType =
                        Telerik.Web.UI.AnimationType.parse(expandAnimationTypeDropDown.get_text());
                    combo.get_expandAnimation().set_type(expandAnimationType);
                    
                    //set the expand duration
                    var expandDurationTextBox = $find("<%= editExpandDuration.ClientID %>");
                    var expandDuration = parseInt(expandDurationTextBox.get_value());
                    combo.get_expandAnimation().set_duration(expandDuration);
                    
                    // set the collapse animation                
                    var collapseAnimationTypeDropDown = $find("<%= ddlCollapseType.ClientID %>");            
                    var collapseAnimationType =
                        Telerik.Web.UI.AnimationType.parse(collapseAnimationTypeDropDown.get_text());
                    combo.get_collapseAnimation().set_type(collapseAnimationType);
                    
                    //set collapse duration
                    var collapseDurationTextBox = $find("<%= editCollapseDuration.ClientID %>");
                    var collapseDuration = parseInt(collapseDurationTextBox.get_value());
                    combo.get_collapseAnimation().set_duration(collapseDuration);
                    
                    //show the dropdown
                    combo.showDropDown();
                    
                    return false;
                }
            </script>

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