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

Remove raddock from Dockzone

2 Answers 60 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Debajyoti
Top achievements
Rank 1
Debajyoti asked on 08 Jan 2014, 01:21 PM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Jan 2014, 07:42 AM
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.

0
Debajyoti
Top achievements
Rank 1
answered on 09 Jan 2014, 08:59 AM
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
Tags
Dock
Asked by
Debajyoti
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Debajyoti
Top achievements
Rank 1
Share this question
or