This is a migrated thread and some comments may be shown as answers.

EnableAnimation when using RadDock1.Collapsed = True in code behind

1 Answer 89 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Richard M
Top achievements
Rank 1
Richard M asked on 16 Aug 2010, 08:13 PM
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?

1 Answer, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 18 Aug 2010, 04:42 PM
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">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableCdn="true">
        <CdnSettings TelerikCdn="Enabled" />
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
        function Button1_onclick()
        {
            var dock = $find("RadDock1");
            dock.set_collapsed(!dock.get_collapsed(), true);
        }
 
    </script>
    <div>
        <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"
                    EnableAnimation="true">
                    <ContentTemplate>
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        CONTENT
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                    </ContentTemplate>
                </telerik:RadDock>
            </telerik:RadDockZone>
        </telerik:RadDockLayout>
    </div>
    </form>
</body>
</html>


Regards,
Pero
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
Tags
Dock
Asked by
Richard M
Top achievements
Rank 1
Answers by
Pero
Telerik team
Share this question
or