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

how to get RadZone Id in Onclient event of RadDock

4 Answers 74 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Jesmon
Top achievements
Rank 1
Jesmon asked on 26 Mar 2012, 05:40 AM
Hi,
        I have One raddock located at radDockZone1 and moved the raddock from RadDockZone1 to RadDockZone2.
        I want to get the  droped zone id  before drop and after drop on OnClientDockPositionChanged  event. Please help
Thanks in advance
Jesmon Joseph

4 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 28 Mar 2012, 02:27 PM
Hi Jesmon,

In order to get the ID of the current and the previous RadDockZone, you can use the client-side events of RadDock OnClientDockPositionChanging and OnClientDockPositionChanged. The first one is fired before the RadDock control is docked, so if you use the get_dockZoneID method, you will get the ID of the RadDockZone, in which the dock control was docked before changing its position. OnClientDockPositionChanged is fired after the RadDock is dropped in the RadDockZone, so in the handler of this event you can use again get_dockZoneID to get the ID of the new dock zone.

The following example demonstrates how to display a message that contains the old and the new RadDockZone ID, when a RadDock control is dragged:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="Scriptmanager1" runat="server" />
    <script type="text/javascript">
        function DockPositionChanging(sender, args) {
            $get("message").innerHTML = "Old dock zone id is: " + sender.get_dockZoneID() + ".";
        }
 
        function DockPositionChanged(sender, args) {
            $get("message").innerHTML += " Current dock zone id is: " + sender.get_dockZoneID() + ".";
        }
    </script>
    <div>
        <telerik:RadDockLayout runat="server" ID="RadDockLayout1">
            <telerik:RadDockZone runat="server" ID="RadDockZone1" Width="300px" MinHeight="100px">
                <telerik:RadDock runat="server" ID="RadDock1" Width="300px" Height="50px" OnClientDockPositionChanging="DockPositionChanging" OnClientDockPositionChanged="DockPositionChanged">
                </telerik:RadDock>
            </telerik:RadDockZone>
            <telerik:RadDockZone runat="server" ID="RadDockZone2" Width="300px" MinHeight="100px">
            </telerik:RadDockZone>
        </telerik:RadDockLayout>
    </div>
    <span id="message"></span>
    </form>
</body>
</html>


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.
0
Jesmon
Top achievements
Rank 1
answered on 29 Mar 2012, 05:21 AM
Hi Slav ,
                Thanks for the support and its works fine for me.
Thanks & regards
Jesmon Joseph
0
Jesmon
Top achievements
Rank 1
answered on 29 Mar 2012, 06:57 AM
Hi Slav ,
                I have another issue with radDock. I have a image control inside the RadDock and Problem is image size is large , then Scrolling coming for RadDock. Is there any property to Autofit the image inside the RadDock. Please help

Thanks in Advance
Jesmon Joseph
0
Slav
Telerik team
answered on 02 Apr 2012, 12:55 PM
Hello Jesmon,

It is recommended to use the client-side methods set_width and set_height of RadDock (after referencing its client object as described here) to specify the size of the RadDock according to its content.

Note that the RadWindow control has an feature for resizing according to the window's content, so you can consider using it instead if only need to display a particular image.

All the best,
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
Jesmon
Top achievements
Rank 1
Answers by
Slav
Telerik team
Jesmon
Top achievements
Rank 1
Share this question
or