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

Can I lock a dock to the top of a zone

1 Answer 23 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Keith
Top achievements
Rank 2
Keith asked on 03 May 2013, 10:14 PM
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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Slav
Telerik team
answered on 08 May 2013, 05:56 PM
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) {
            sender.undock();
            $find("RadDockZone1").dock(sender, 1)
        }
    }
 
</script>
<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>
    </telerik:RadDockZone>
</telerik:RadDockLayout>

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

Greetings,
Slav
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.
Tags
Dock
Asked by
Keith
Top achievements
Rank 2
Answers by
Slav
Telerik team
Share this question
or