Back to Devexpress

ASPxDockManager.ClientLayout Event

aspnet-devexpress-dot-web-dot-aspxdockmanager-71873a9a.md

latest2.8 KB
Original Source

ASPxDockManager.ClientLayout Event

Allows you to save and restore the previously saved layout of panels and zones managed by the ASPxDockManager.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public event ASPxClientLayoutHandler ClientLayout
vb
Public Event ClientLayout As ASPxClientLayoutHandler

Event Data

The ClientLayout event's data class is ASPxClientLayoutArgs. The following properties provide information specific to this event:

PropertyDescription
LayoutDataGets or sets the layout data.
LayoutModeIndicates whether a control’s layout should be saved or restored.

Remarks

Handle the ClientLayout event to save and restore the layout from a data store.

Save LayoutThe event parameter’s LayoutMode property returns Saving. The LayoutData property contains the ASPxDocking’s current layout that should be saved, for example, to a database.Restore LayoutThe LayoutMode property returns Loading. Read the ASPxDocking’s layout data from a data store and assign it to the LayoutData property.

Run Demo: Docking - Layout Management

csharp
protected void ASPxDockManager1_ClientLayout(object sender, ASPxClientLayoutArgs e) {
    if (e.LayoutMode == ClientLayoutMode.Saving && this.saveLayout) {
        DataRow row = LayoutDataSource.NewRow();
        row["Date"] = DateTime.Now.ToString();
        row["LayoutString"] = e.LayoutData;
        LayoutDataSource.Rows.Add(row);
    }
    if (e.LayoutMode == ClientLayoutMode.Loading && grid.Selection.Count != 0) {
        e.LayoutData = grid.GetSelectedFieldValues("LayoutString")[0].ToString();
    }
}

See Also

Layout Management

Docking

ASPxDockManager Class

ASPxDockManager Members

DevExpress.Web Namespace