| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
| |
| <%@ 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 runat="server"> |
| <title></title> |
| <script type="text/javascript"> |
| function dockInitialize(obj, args) |
| { |
| OverrideClose(); |
| } |
| </script> |
| </head> |
| <body> |
| <form id="Form1" method="post" runat="server"> |
| <asp:ScriptManager ID="ScriptManager" runat="server"/> |
| <div> |
| Select Module: |
| <asp:DropDownList runat="server" ID="DroptDownWidget" Width="150"> |
| <asp:ListItem Text="ExchangeRates.ascx" Value="~/UserControls/ExchangeRates.ascx" |
| Selected="true"></asp:ListItem> |
| <asp:ListItem Text="Horoscopes.ascx" Value="~/UserControls/Horoscopes.ascx"></asp:ListItem> |
| <asp:ListItem Text="News.ascx" Value="~/UserControls/News.ascx"></asp:ListItem> |
| <asp:ListItem Text="Weather.ascx" Value="~/UserControls/Weather.ascx"></asp:ListItem> |
| </asp:DropDownList> |
| <br /> |
| Select Docking Zone: |
| <asp:DropDownList ID="DropDownZone" runat="server" DataSource="<%#GetZones() %>" |
| DataTextField="ID" DataValueField="ClientID" Width="150"> |
| </asp:DropDownList> |
| <asp:Button runat="server" ID="ButtonAddDock" Text="Add Dock (AJAX)" OnClick="ButtonAddDock_Click" /> |
| <asp:Button runat="server" ID="ButtonPostBack" Text="Make PostBack" OnClick="ButtonPostBack_Click" /> |
| </div> |
| <asp:UpdatePanel runat="server" ID="UpdatePanel2"> |
| <ContentTemplate> |
| <br /> |
| <telerik:RadDockLayout runat="server" ID="RadDockLayout1" OnSaveDockLayout="RadDockLayout1_SaveDockLayout" |
| OnLoadDockLayout="RadDockLayout1_LoadDockLayout"> |
| <telerik:RadDockZone runat="server" ID="RadDockZone1" Width="300" MinHeight="200" |
| Style="float: left; margin-right: 15px; background: #f5f4e8;"> |
| </telerik:RadDockZone> |
| <telerik:RadDockZone runat="server" ID="RadDockZone2" Width="300" MinHeight="200" |
| Style="background: #d5f0fa; float: left;"> |
| </telerik:RadDockZone> |
| </telerik:RadDockLayout> |
| </ContentTemplate> |
| <Triggers> |
| <asp:AsyncPostBackTrigger ControlID="ButtonAddDock" EventName="Click" /> |
| </Triggers> |
| </asp:UpdatePanel> |
| <div style="width: 0px; height: 0px; overflow: hidden; position: absolute; left: -10000px;"> |
| Hidden UpdatePanel, which is used to help with saving state when minimizing, moving |
| and closing docks. This way the docks state is saved faster (no need to update the |
| docking zones). |
| <asp:UpdatePanel runat="server" ID="UpdatePanel1"> |
| <ContentTemplate> |
| </ContentTemplate> |
| </asp:UpdatePanel> |
| </div> |
| |
| <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> |