Dynamic RadDock remove from session when closed

2 posts, 0 answers
  1. Matt
    Matt avatar
    10 posts
    Member since:
    Jul 2008

    Posted 17 Jul 2009 Link to this post

    I am trying to create a dashboard using the RadDockZone and dynamic RadDocks as per your example (http://demos.telerik.com/aspnet-ajax/dock/examples/myportal/defaultcs.aspx).

    However, you can update the RadDocks in session (I will later add this to a DB) and can control adding/moving and expand/collapse, but you cannot remove from session individual items.  I am trying to catch the "Close" command so that I can remove an individual item only from session, in the example it only shows how to clear all items from session.  The problem that I have is that the "Close" command does not seem to fire a PostBack unlike the move/expand/collapse, is there a way for me to achieve this?
  2. Pero
    Pero avatar
    1156 posts

    Posted 21 Jul 2009 Link to this post

    Hi Matt,

    This issue is present only in the version that you are using. You can download the latest official version of the RadControls for ASP.NET AJAX Q2 2009 where the issue is already fixed. Additionally you can workaround the problem as shown below:

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head id="Head1" runat="server"
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
            <script type="text/javascript"
                function dockInitialize(obj, args) { 
            <style id="dockStyles" type="text/css" runat="server"
        <form id="form1" runat="server"
            <asp:ScriptManager ID="ScriptManager" runat="server" /> 
            <telerik:RadDockLayout ID="RadDockLayout2" runat="server"
                <telerik:RadDockZone ID="RadDockZone3" runat="server" Height="300px" Width="300px"
                    <telerik:RadDock ID="RadDock1" runat="server" Width="300px" OnClientInitialize="dockInitialize"
            <script type="text/javascript"
                //FIX the problem when dock is without animation.   
                function OverrideClose() { 
                    if (Telerik.Web.UI) { 
                        if (Telerik.Web.UI.RadDock) { 
                            var old_SetClosed = Telerik.Web.UI.RadDock.prototype.set_closed; 
                            Telerik.Web.UI.RadDock.prototype.set_closed = function(value, playAnimation) { 
                                if (value == true) { 
                                    this._closed = value
                                    var element = this.get_element(); 
                                    element.style.display = "none"
                                    Telerik.Web.UI.DockCloseCommand.callBaseMethod(this.getCommand("Close"), 'onCommand'); 
                                else { 
                                    old_SetClosed(value, playAnimation); 

    Please excuse us for the inconvenience.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top