EnableAnimation when using RadDock1.Collapsed = True in code behind

2 posts, 0 answers
  1. Richard M
    Richard M avatar
    76 posts
    Member since:
    Mar 2010

    Posted 16 Aug 2010 Link to this post

    When I collapse/expand my RadDock in code-behind using RadDock1.Collapsed = True, even if I have EnableAnimation="True" set in my RadDock1, it does not show the animation.  Is there a way to do this?
  2. Pero
    Pero avatar
    1156 posts

    Posted 18 Aug 2010 Link to this post

    Hi Richard,

    The RadDock animations are intended to be used when the actual command is fired or the actual action occurs, and not when setting the properties programmatically. Another thing is that when any of the server-side properties are set, a postback or ajax call must occur, which means the whole HTML of the dock will be recreated and the animation cannot be performed.
    You could, however, expand/collapse the dock on the client using the
    dock.set_collapsed(shouldCollapse, shouldPlayAnimation) client-side method, as shown in the following page:

    <%@ Page Language="C#" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableCdn="true">
            <CdnSettings TelerikCdn="Enabled" />
        <script type="text/javascript">
            //Put your JavaScript code here.
            function Button1_onclick()
                var dock = $find("RadDock1");
                dock.set_collapsed(!dock.get_collapsed(), true);
            <input id="Button1" type="button" value="Expand/Collapse" onclick="return Button1_onclick()" />
            <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
                <telerik:RadDockZone ID="RadDockZone1" runat="server" MinHeight="300px" Width="300px">
                    <telerik:RadDock ID="RadDock1" runat="server" Title="RadDock-Title" Width="300px"
                            <br />
                            <br />
                            <br />
                            <br />
                            <br />
                            <br />
                            <br />
                            <br />
                            <br />
                            <br />

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top