URGENT: DockCloseCommand's OnClientCommand does not fire

2 posts, 0 answers
  1. Martin
    Martin avatar
    84 posts
    Member since:
    Apr 2009

    Posted 14 Sep 2009 Link to this post

    Everything was working fine. We've upgraded to 2009.1.527.35 and it broke the close command on docs.



    DockCloseCommand objDockCloseCommand = new DockCloseCommand();


    objDockCloseCommand.OnClientCommand =



    objDockCloseCommand.Text =






    function dockClose_Click() {


    //this never gets executed




    Funny part about it is that if dockClose_Click does not exist I get an error when page loads.
    Please help, this is urgent.

  2. Pero
    Pero avatar
    1156 posts

    Posted 15 Sep 2009 Link to this post

    Hello Martin,

    This is a known problem with the 2009.1.527 version of the RadDock control. In some of the previous versions we added animations and If you set the RadDock's EnableAnimation property to false (by default is false) the event for the close command will not be fired. The problem is fixed and I recommend that you upgrade to the latest version available. However, if you decide to stay with the 2009.1 527 version you can workaround this issue by overriding the set_closed method as is shown below:

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
    <!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"
        <title>Untitled Page</title> 
        <script type="text/javascript"
            function DockCommand(obj, args) 
        <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server"
        <asp:Button runat="server" Text="Postback" /> 
            <asp:Label ID="Label1" runat="server"></asp:Label> 
            <telerik:RadDockLayout ID="RadDockLayout1" runat="server"
                <telerik:RadDockZone ID="RadDockZone1" runat="server"
                    <telerik:RadDock ID="RadDock1" runat="server"
                            <telerik:DockCloseCommand OnClientCommand="DockCommand" /> 
        <script type="text/javascript"
            //FIX the problem when dock is without animation.   
            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'); 
                    old_SetClosed(value, playAnimation); 

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top