Making a dock expand on click

3 posts, 1 answers
  1. Ashley
    Ashley avatar
    22 posts
    Member since:
    Jul 2010

    Posted 05 Aug 2010 Link to this post

    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. Answer
    Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 09 Aug 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ashley
    Ashley avatar
    22 posts
    Member since:
    Jul 2010

    Posted 13 Aug 2010 Link to this post

    Hi Petio,

    Thank you for your help.

    regards,

     Ash
Back to Top