Dock Command to move Dock control arround

2 posts, 0 answers
  1. Michael
    Michael avatar
    1 posts
    Member since:
    Dec 2008

    Posted 30 Jul 2013 Link to this post

    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.
  2. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 02 Aug 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top