RadDock for ASP.NET

Docking Manager Send comments on this topic.
Defining dynamic layouts with RadDock controls > Docking Manager

Glossary Item Box

RadDockingManager allows docking on page for the whole layout. This requires its tag to be placed before the other two components RadDockingZone and RadDockableObject of Telerik RadDock:

 

<rad:RadDockingManager id="RadDockingManager1" runat="server">
</rad:RadDockingManager>

 ...

 

It is very important that RadDockingManager is placed before any RadDockingZone and RadDockableObject controls in the form.

 

In reference to the above said we recommend you to start building your Telerik RadDock layout from a new clear web page and track down the following steps:

 

1. Doubleclick RadDockingManager Toolbox icon thus it will be automatically placed before the other two components RadDockingZone and RadDockableObject of Telerik RadDock in the form.  

 

2. Set the license key.

 

3. Set RadControls directory if it is different from the default one. 

 

4. Set the desired skin if needed.

 

5. By default while dragging a dockable object its content is visible. For a better performance and to allow easy and smooth dragging it is better to drag an empty box with only border and background. For this purpose disable the content while dragging by setting the RadDockingManager.ShowContentWhileDragging property to "False" (it is "True" by default).

 

Consider the following example: 

Don't show content while dragging

 

<rad:RadDockingManager id="RadDockingManager1" runat="server" ShowContentWhileDragging="False"></rad:RadDockingManager>

[C#]

RadDockingManager1.ShowContentsWhileDragging = false;

[VB]

RadDockingManager1.ShowContentsWhileDragging = False

 

6. Telerik RadDock allows users to store the current layout and later reload it again. You can use RadDockingManager.SaveState() function to save the current layout state as string. This string can be saved in a database or a file and later using RadDockingManager.LoadState() function given the string as input parameter to reload the position and state of dockable objects.   

Consider the following example:

<%@ Page language="c#" %>
<%@ Register TagPrefix="rad" Namespace="Telerik.WebControls" Assembly="RadDock" %>

<rad:RadDockingManager id="RadDockingManager1" runat="server"></rad:RadDockingManager>
    ...
    <rad:RadDockingZone id=RadDockingZone1 runat="server" Width="100%" Height="100%">
      <rad:RadDockableObject id=RadDockableObject1 runat="server" Text="Object 1">
         <ContentTemplate>
           Object 1
         </ContentTemplate>
      </rad:RadDockableObject>
      <rad:RadDockableObject id=RadDockableObject2 runat="server" Text="Object 2" Behavior="Resizable">
         <ContentTemplate>
           Object 2
         </ContentTemplate>
      </rad:RadDockableObject>
     </rad:RadDockingZone>
         ...
     <rad:RadDockingZone id=RadDockingZone2 runat="server" Width="100%" Height="100%">
     </rad:RadDockingZone>
         ...
     <asp:Button ID="btnSaveState" Runat="server" Text="Save state"></asp:Button>

 

[C#] 

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace Telerik.DockExamplesCSharp.SaveLoadState
{
    public class DefaultCS : System.Web.UI.Page
    {
        protected Telerik.WebControls.RadDockingManager RadDockingManager1;
        protected Button btnSaveState;

        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                // When the page is requested and a layout is already stored
                // in the Application object it is loaded.
                object state = this.Application["RadDockState"];
                if (state is string)
                {
                    RadDockingManager1.LoadState((string)state);
                }
            }
        }

        #region Web Form Designer generated code
        override protected void OnInit(EventArgs e)
        {
            InitializeComponent();
            base.OnInit(e);
        }

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.Load += new System.EventHandler(this.Page_Load);
            btnSaveState.Click += new EventHandler(btnSaveState_Click);
         }
        #endregion

        private void btnSaveState_Click(object sender, EventArgs e)
        {
            // When "Save state" button is pressed the current
            // layout is stored in the Application object
            this.Application["RadDockState"] = RadDockingManager1.SaveState();
        }

    }
}