Skip to main content
A newer version of this page is available. .
Tab

ASPxGridBase.ClientLayout Event

Enables you to save and restore the previously saved layout of the grid.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

NuGet Package: DevExpress.Web

Declaration

public event ASPxClientLayoutHandler ClientLayout

Event Data

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

Property Description
LayoutData Gets or sets the layout data.
LayoutMode Indicates whether a control’s layout should be saved or restored.

Remarks

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

Save Layout

Restore Layout

You can also save and restore the grid’s layout via the ASPxGridBase.SaveClientLayout and ASPxGridBase.LoadClientLayout methods.

Concept

Save and Restore Layout

Example

This example shows how to save or restore the ASPxGridView layout to or from a data store.

protected void ASPxGridView1_ClientLayout(object sender, 
DevExpress.Web.ASPxClientLayoutArgs e) {
    if (e.LayoutMode == DevExpress.Web.ClientLayoutMode.Saving) {
        SaveUserLayoutToDatabase(userID, "AccountGrid", e.LayoutData);
    }
    else {
        if (System.IO.File.Exists(fileName))
            e.LayoutData = RestoreUserLayoutFromDatabase(userID, "AccountGrid");
    }
}
See Also