Layout Management

  • 2 minutes to read

ASPxDockManager allows you to save and restore the previously saved information on layout of panels on the page. This information includes the settings that control the visibility, an owner zone, position within the zone, allowed dock state, size, and position of panels on the page.

The ASPxDockManager's ASPxDockManager.ClientLayout event enables you to save the panels' layout each time it is being changed and restore it on the first page load. This event provides the ASPxClientLayoutArgs.LayoutMode property that indicates whether the layout should be saved or restored.

The example below shows how to save/restore the docking layout to/from a session.

using DevExpress.Web.ASPxClasses;
using DevExpress.Web.ASPxDocking;


protected void dockManager_ClientLayout(object sender, DevExpress.Web.ASPxClientLayoutArgs e) {
     if(e.LayoutMode == ClientLayoutMode.Saving) 
          Session[LayoutSessionKey] = e.LayoutData;
     if(e.LayoutMode == ClientLayoutMode.Loading)
          e.LayoutData = Session[LayoutSessionKey] as string;

ASPxDockManager allows you to reset all panels (dock state, owner zone, size, position, etc.) on the page to the initial (specified in markup) state using the ASPxDockManager.ResetLayoutToInitial method.

You can prohibit end-users from the docking layout changes using the ASPxDockManager.FreezeLayout property. In this case, changing a panel's dock state and rearranging panels within a zone by dragging them is not permitted.

See Also