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

Collapse only one dock at a time

1 Answer 15 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 09 Aug 2010, 09:43 PM
Is there a way to only have one RadDock collapsed at a time?

1 Answer, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 10 Aug 2010, 04:56 PM
Hi Richard M,

You should write custom JavaScript code, which will expand all other RadDocks when you collapse 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">
    <title></title>
    <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() == true)
                {  
                    for (var i = 0; i < allDocks.length; i++)
                    {
                        if (allDocks[i] != dock)
                        {
                            allDocks[i].set_collapsed(false);
                        }
                          
                    }
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <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>  
                <telerik:RadDock ID="RadDock2" runat="server" Text="RadDock2" DockMode="Docked" OnClientCommand="DockCommand" OnClientInitialize="DockInit">  
                </telerik:RadDock>  
                <telerik:RadDock ID="RadDock3" runat="server" Text="RadDock3" DockMode="Docked" OnClientCommand="DockCommand" OnClientInitialize="DockInit">  
                </telerik:RadDock>  
            </telerik:RadDockZone>  
            <telerik:RadDockZone ID="RadDockZone2" runat="server" UniqueName="RadDockZone2">  
            </telerik:RadDockZone>  
  
        </telerik:RadDockLayout>
      
    </div>
    </form>
</body>
</html>



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