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

Making a dock expand on click

2 Answers 35 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Ashley
Top achievements
Rank 1
Ashley asked on 05 Aug 2010, 09:19 AM
Hi,

I am intending on making a dock expand to a bigger size upon clicking the content, is there any possible way you could help me with going about this task.

Any help is appreciated,

Ash.

2 Answers, 1 is accepted

Sort by
0
Accepted
Petio Petkov
Telerik team
answered on 09 Aug 2010, 03:47 PM
Hello Ashley,

You can use RadDock's set_width and set_height client-side methods to change its size. Here it is a simple example:
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!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>
    <script type="text/javascript">
        function changeSize()
        {
            var dock = $find("RadDock1");
            var width = dock.get_width();
            width = parseInt(width) + 20;
            dock.set_width(width);
            var height = dock.get_height();
            height = parseInt(height) + 20;
            dock.set_height(height);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
            <telerik:RadDock ID="RadDock1" runat="server" Title="SomeTitle" Width="200px" Height="200px">
                <ContentTemplate>
                    <input type="button" value="Change Size" onclick="changeSize()" />
                </ContentTemplate>
            </telerik:RadDock>
        </telerik:RadDockLayout>
    </div>
    </form>
</body>
</html>
More about RadDock's client-side API is available here:
http://www.telerik.com/help/aspnet-ajax/dock_client-side_basics.html


Best wishes,
Petio Petkov
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
0
Ashley
Top achievements
Rank 1
answered on 13 Aug 2010, 10:43 AM
Hi Petio,

Thank you for your help.

regards,

 Ash
Tags
Dock
Asked by
Ashley
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Ashley
Top achievements
Rank 1
Share this question
or