Back to Devexpress

ASPxClientLayoutArgs.LayoutMode Property

aspnet-devexpress-dot-web-dot-aspxclientlayoutargs.md

latest1.9 KB
Original Source

ASPxClientLayoutArgs.LayoutMode Property

Indicates whether a control’s layout should be saved or restored.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public ClientLayoutMode LayoutMode { get; }
vb
Public ReadOnly Property LayoutMode As ClientLayoutMode

Property Value

TypeDescription
ClientLayoutMode

A ClientLayoutMode enumeration value that indicates whether a web control’s layout should be saved or restored.

|

Available values:

NameDescription
Loading

A web control’s ClientLayout event should be handled to restore the previously saved layout.

| | Saving |

A web control’s ClientLayout event should be handled to save the control’s layout to a data store.

|

Remarks

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

ASPxClientLayoutArgs Class

ASPxClientLayoutArgs Members

DevExpress.Web Namespace