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

how to get new dockzone after dock movement

2 Answers 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
reza
Top achievements
Rank 1
reza asked on 25 Oct 2011, 09:42 AM
Hi
I want to get the destination zone of a dock after it's movement on client side,
I use [OnClientDragEnd(sender,arg)] event and try to use [sender.get_dockZoneID()] to get the destination zoneID but I get the source zoneID of the dock before it's drag.
How can I get the destination zoneID ?

Thank you very much for your feedback.


this is the sample code that I use :


<telerik:RadScriptBlock ID="asdaSD" runat="server">
        <script type="text/javascript">
            function drag_end(sender, eventArgs) {
                alert(sender.get_dockZoneID());
                
            }

            
        </script>
        </telerik:RadScriptBlock>
    <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
    <table>
            <tr>
                <td style="vertical-align: top">
                zone 1
                    <telerik:RadDockZone ID="RadDockZone1" runat="server" Orientation="Vertical" Width="250px"
                        MinHeight="400px">
                        <telerik:RadDock ID="RadDock1" runat="server" Title="Blogs" Width="250px" EnableAnimation="true"
                            EnableRoundedCorners="true" Resizable="true" OnClientDragEnd="drag_end">
                            <ContentTemplate>
                                <asp:Label ID="Label1" runat="server" Text="dock1"></asp:Label>
                            </ContentTemplate>
                        </telerik:RadDock>
                    </telerik:RadDockZone>
                </td>
                <td style="vertical-align: top">
                zone 2
                    <telerik:RadDockZone ID="RadDockZone2" runat="server" Orientation="Vertical" Width="560px"
                        MinHeight="400px">
                        <telerik:RadDock ID="RadDock2" runat="server" Title="News" Width="250px" EnableAnimation="true"
                            EnableRoundedCorners="true" Resizable="true">
                            <ContentTemplate>
                                <asp:Label ID="Label2" runat="server" Text="dock2"></asp:Label>
                            </ContentTemplate>
                        </telerik:RadDock>
                    </telerik:RadDockZone>
                </td>
            </tr>
        </table>
    </telerik:RadDockLayout>

2 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 27 Oct 2011, 03:53 PM
Hello Reza,

As you have enabled the animation of the RadDock, when the dragging of a dock control has ended, its property DockZoneID still contains the ID of the old dock zone. You can get the destination zone's id simply by using the client event OnClientDockPositionChanged instead of OnClientDragEnd in your code.
<telerik:RadDock ID="RadDock1" runat="server" Title="Blogs" Width="250px" EnableAnimation="true"
    EnableRoundedCorners="true" Resizable="true" OnClientDockPositionChanged="drag_end">
    <ContentTemplate>
        <asp:Label ID="Label1" runat="server" Text="dock1"></asp:Label>
    </ContentTemplate>
</telerik:RadDock>


Regards,
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
0
reza
Top achievements
Rank 1
answered on 05 Nov 2011, 05:21 AM
OK
Thanks
Tags
General Discussions
Asked by
reza
Top achievements
Rank 1
Answers by
Slav
Telerik team
reza
Top achievements
Rank 1
Share this question
or