how to get RadZone Id in Onclient event of RadDock

5 posts, 0 answers
  1. Jesmon
    Jesmon avatar
    17 posts
    Member since:
    Jul 2012

    Posted 26 Mar 2012 Link to this post

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

    Posted 28 Mar 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jesmon
    Jesmon avatar
    17 posts
    Member since:
    Jul 2012

    Posted 29 Mar 2012 Link to this post

    Hi Slav ,
                    Thanks for the support and its works fine for me.
    Thanks & regards
    Jesmon Joseph
  5. Jesmon
    Jesmon avatar
    17 posts
    Member since:
    Jul 2012

    Posted 29 Mar 2012 Link to this post

    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
  6. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 02 Apr 2012 Link to this post

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