Remove raddock from Dockzone

3 posts, 0 answers
  1. Debajyoti
    Debajyoti avatar
    2 posts
    Member since:
    Jan 2014

    Posted 08 Jan 2014 Link to this post

    Hi,
    I want to remove the dynamically created RadDock from the DockZone after clicking on the close button in RadDock. 
    And I want to do this from the client side.
    Please help me with Code.
    Here is my Code.

                RadDock Rd = new Telerik.Web.UI.RadDock();
                Rd.EnableAnimation = true;
                Rd.Skin = "Default";
                Rd.Visible = true;
                Rd.DockMode = DockMode.Docked;
                Rd.EnableAjaxSkinRendering = false;
                Rd.OnClientDockPositionChanged = "OnClientDockPositionChanged";
                Rd.OnClientCommand = "OnClientCommand";
                RadDockZone1.Controls.Add(Rd);

    <script type="text/javascript">

            function OnClientDockPositionChanged(sender, eventArgs)
           {
                var doczone = $find("<%=RadDockZone1.ClientID%>");
                var docks = doczone.get_docks().length;
                document.getElementById("<%=ltltest.ClientID%>").innerText = docks;
            }
            function OnClientCommand(sender, eventArgs)
           {
                //HERE WILL BE THE CODE WHICH WILL REMOVE THE corresponding RadDock
    }


    Please help me...


    Thanks & Regards
    Debajyoti Saha
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Jan 2014 Link to this post

    Hi Debajyoti,

    By default RadDock is behavior is like that it will close the corresponding RadDock on clicking the Close Button of RadButton. We don't need to write any code for that. I tried your code which works fine at my end, it is removing the dynamically created RadDock by clicking on the Close Button. Please have a look into this help documentation to know the working of RadDock Close Button.

    Please elaborate your requirement if it doesn't help.
    Thanks,
    Shinu.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Debajyoti
    Debajyoti avatar
    2 posts
    Member since:
    Jan 2014

    Posted 09 Jan 2014 Link to this post

    Hi Shinu,

    Thanks for your reply. Bt I want to remove the RadDock from the DockZone permanently not only close. If i click on close button on RadDock it will be just disappear from the DockZone but not deleted. I want to delete it.

    Here the scenario.
    I have created 3 RadDock dynamically in a dock zone. Now when i close one RadDock it has been closed. It has been disappear from the page but in the next step when i count the Raddocks present in the Dockzone it remains the same thats 3. I want the number will be 2 means one RadDock has been deleted or removed after clicking CLOSE button on that RadDock.

    And this will be done in client Side.

    If it is possible please tell me the steps(with code).   

    Thanks & Regards
    Debajyoti saha
Back to Top