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

Dock Command to move Dock control arround

1 Answer 40 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 30 Jul 2013, 08:13 AM
Hi


Is it possible to use a new Dock command to drag and drop the dock control instead of the dock's control tool bar ?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 02 Aug 2013, 07:43 AM
Hello Michael,

You can add a custom command in the RadDock and configure its HTML element as a custom drag handle for the control. Please check the following code sample for a reference:
<script type="text/javascript">
    function SetHandleDock(dock, args) {
        var dockElement = dock.get_element();
        var dragHandle = $telerik.$(dockElement).find(".rdCustom")[0];
        dock.set_handle(dragHandle);
    }
</script>
<telerik:RadDockLayout runat="server" ID="RadDockLayout1">
    <table style="width: 757px; height: 352px;">
        <tr>
            <td style="padding-top: 20px; vertical-align: top;">
                <telerik:RadDockZone runat="server" ID="RadDockZone1"
                    Orientation="Vertical" MinHeight="300px" Width="200px">
                    <telerik:RadDock ID="RadDock1" Title="RadDock2" runat="server" Width="200px" OnClientInitialize="SetHandleDock">
                        <ContentTemplate>
                            <div style="padding: 11px; text-align: center;">
                                <img id="Handle_RadDock2" alt="Image" src="Img/drag.gif" style="cursor: move;" /><br />
                                You can drag this object using the image above.
                            </div>
                        </ContentTemplate>
                        <Commands>
                            <telerik:DockCommand Text="Drag" />
                        </Commands>
                    </telerik:RadDock>
                </telerik:RadDockZone>
            </td>
        </tr>
    </table>
</telerik:RadDockLayout>


Regards,
Slav
Telerik
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 the blog feed now.
Tags
Dock
Asked by
Michael
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or