ASPxTreeList.ClientLayout Event

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

Namespace: DevExpress.Web.ASPxTreeList

Assembly: DevExpress.Web.ASPxTreeList.v19.2.dll

Declaration

public event ASPxClientLayoutHandler ClientLayout
Public Event ClientLayout As ASPxClientLayoutHandler

Event Data

The ClientLayout event handler receives an argument of the ASPxClientLayoutArgs type. 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 tree list's layout from a data store.

You can also save and restore the tree list's layout by using the ASPxTreeList.SaveClientLayout and ASPxTreeList.LoadClientLayout methods.

Examples

This example shows how to save/restore the ASPxTreeList's layout to/from a data store.

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