New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Load/Save Layout

Databound control
  • Collapse
  • Close
  • Collapse
  • Close
This is a dock with some text inside
  • Demo Configurator

Persisting the Dock Layout

The API of RadDockLayout provides developers with the ability to save the positions of the dock objects on the page in various storage mediums, such as Database, Session, Cookie, etc. To accomplish such a scenario, you should use the LoadDockLayout and SaveDockLayout events.

The example above saves the DockLayout in a cookie when the "Save Current Layout" button is clicked. The user can reset the DockLayout to a predefined one by pressing the "Reset Layout" button.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
    • DefaultCS.aspx.cs
    • UnitConverter.cs
  • styles.css
<%@ Page Language="c#" AutoEventWireup="true" Inherits="Telerik.Web.Examples.Dock.LoadSaveState.DefaultCS"CodeFile="DefaultCS.aspx.cs"  %>

<!DOCTYPE html>
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" />
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-wide">
        <telerik:RadDockLayout runat="server" EnableViewState="false" ID="RadDockLayout1"
            OnLoadDockLayout="RadDockLayout1_LoadDockLayout" StoreLayoutInViewState="false">
            <telerik:RadDockZone runat="server" ID="RadDockZone2" Orientation="vertical" CssClass="dock-zone">
                <telerik:RadDock RenderMode="Lightweight" runat="server" ID="RadDock3" Title="Databound control" Width="300px" CssClass="higherZIndex">
                        <asp:GridView runat="server" ID="GridView1" Width="100%">
            <telerik:RadDockZone runat="server" ID="RadDockZone1" Orientation="vertical" CssClass="dock-zone">
                <telerik:RadDock RenderMode="Lightweight" runat="server" ID="RadDock2" Title="Text" Height="80px" Width="300px"
                    Text="This is a dock with some text inside" CssClass="higherZIndex">
    <qsf:ConfiguratorPanel runat="server">
            <qsf:View runat="server">
                <qsf:Button ID="btnSaveState" runat="server" Text="Save Current Layout" OnClick="btnSaveState_Click" />
                <qsf:Button ID="btnReset" runat="server" Text="Reset Layout" OnClick="btnReset_Click" />

Support & Learning Resources

Find Assistance