Layout Management
- 2 minutes to read
ASPxDockManager allows you to save and restore previously saved information on a page’s panel layout. This allows you to get the following information:
Visibility settings.
Information about a zone that contains a panel.
A panel’s position within the zone.
Allowed dock state.
Dock size.
The position of panels on the page.
ASPxDockManager’s ASPxDockManager.ClientLayout event enables you to save the panel layout each time it is changed and restore it on the first page load. The ASPxClientLayoutArgs.LayoutMode event’s argument indicates whether to save or restore the layout.
The example below shows how to save/restore the docking layout to/from a session.
using DevExpress.Web;
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, and so forth) on the page to the initial state (as specified in markup) using the ASPxDockManager.ResetLayoutToInitial method.
You can use the ASPxDockManager.FreezeLayout property to prohibit users from changing the dock layout. In this case, users cannot change a panel’s dock state or drag panels within a zone to rearrange them.