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

Dynamic RadDock remove from session when closed

1 Answer 82 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 17 Jul 2009, 10:03 AM
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?

1 Answer, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 21 Jul 2009, 12:40 PM
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"
    <title></title
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
 
        <script type="text/javascript"
            function dockInitialize(obj, args) { 
                OverrideClose(); 
            }   
        </script> 
 
        <style id="dockStyles" type="text/css" runat="server"
            </style> 
    </telerik:RadCodeBlock> 
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
        <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"
                </telerik:RadDock> 
            </telerik:RadDockZone> 
        </telerik:RadDockLayout> 
 
        <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"
                                this.updateClientState(); 
                                Telerik.Web.UI.DockCloseCommand.callBaseMethod(this.getCommand("Close"), 'onCommand'); 
                            } 
                            else { 
                                old_SetClosed(value, playAnimation); 
                            } 
 
                        } 
                    } 
                } 
            }   
        </script> 
    </form> 
</body> 
</html> 
 


Please excuse us for the inconvenience.

Greetings,
Pero
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.
Tags
Dock
Asked by
Matt
Top achievements
Rank 1
Answers by
Pero
Telerik team
Share this question
or