Expand only 1 RadDock at a time

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

    Posted 12 Aug 2010 Link to this post

    How can I programatically or thru Javascript open only 1 RadDock at a time?
  2. Petio Petkov
    Petio Petkov avatar
    825 posts

    Posted 13 Aug 2010 Link to this post

    Hello Richard M,

    You should write custom JavaScript code, which will collapse all other RadDocks when you expand one of them, e.g.
    <%@ 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 id="Head1" runat="server">
        <script type="text/javascript">
            var allDocks = [];
            function DockInit(dock, args)
                allDocks[allDocks.length] = dock;
            function DockCommand(dock, args)
                var commandName = args.command.get_name();
                if (commandName = "ExpandCollapse")
                    if (dock.get_collapsed() == false)
                        for (var i = 0; i < allDocks.length; i++)
                            if (allDocks[i] != dock)
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
               <telerik:RadDockZone ID="RadDockZone1" runat="server" UniqueName="RadDockZone1">  
                    <telerik:RadDock ID="RadDock1" runat="server" Text="RadDock1" DockMode="Docked" OnClientCommand="DockCommand" OnClientInitialize="DockInit"
                    <telerik:RadDock ID="RadDock2" runat="server" Text="RadDock2" DockMode="Docked" OnClientCommand="DockCommand" OnClientInitialize="DockInit"
                    <telerik:RadDock ID="RadDock3" runat="server" Text="RadDock3" DockMode="Docked" OnClientCommand="DockCommand" OnClientInitialize="DockInit">  
                <telerik:RadDockZone ID="RadDockZone2" runat="server" UniqueName="RadDockZone2">  

    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. DevCraft R3 2016 release webinar banner
Back to Top