Can I lock a dock to the top of a zone

2 posts, 1 answers
  1. Keith
    Keith avatar
    94 posts
    Member since:
    Jun 2012

    Posted 03 May 2013 Link to this post

    I have several dock zones with multiple docks. I have one that I want to remain in position 0 always and the remaining docks should be able to be repositioned as the user desires.

    I've tried setting the properties to: Pinned="true" DockMode="Docked" EnableDrag="false" and the dock will not move, however, if a user drags the dock to the 0 position, the first dock repositions.

    The reason I need to do this is that I am using a collapsable dock as a filter that should remain at the top of the zone 100% of the time.

    Is there a setting I am missing or is this not possible?
  2. Answer
    Slav avatar
    1359 posts

    Posted 08 May 2013 Link to this post

    Hello Keith,

    You can use the client-side API of RadDock and the event OnClientDockPositionChanged in order to detect when a dock is placed on the first position in a RadDockZone and move it to the next position. The following example shows how to achieve this:
    <script type="text/javascript">
        function OnClientDockPositionChanged(sender, args) {
            var dockIndex = sender.get_index();
            if (dockIndex == 0) {
                $find("RadDockZone1").dock(sender, 1)
    <telerik:RadDockLayout runat="server" ID="RadDockLayout1">
        <telerik:RadDockZone runat="server" ID="RadDockZone1" Width="400px" Height="500px">
            <telerik:RadDock runat="server" ID="topRadDock" Title="Always on top" Width="400px" Height="100px"></telerik:RadDock>
            <telerik:RadDock runat="server" ID="RadDock1" Title="RadDock1" Width="400px" Height="100px" OnClientDockPositionChanged="OnClientDockPositionChanged"></telerik:RadDock>
            <telerik:RadDock runat="server" ID="RadDock2" Title="RadDock2" Width="400px" Height="100px" OnClientDockPositionChanged="OnClientDockPositionChanged"></telerik:RadDock>

    Note that you should handle the event OnClientDockPositionChanged of all docks except the top one.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top