aspnet-devexpress-dot-web-dot-aspxtreelist-dot-aspxtreelist-dot-loadclientlayout-x28-system-dot-byte-x29.md
Restores a ASPxTreeList layout from the specified parameter.
Namespace : DevExpress.Web.ASPxTreeList
Assembly : DevExpress.Web.ASPxTreeList.v25.2.dll
NuGet Package : DevExpress.Web
public virtual bool LoadClientLayout(
byte[] layoutData
)
Public Overridable Function LoadClientLayout(
layoutData As Byte()
) As Boolean
| Name | Type | Description |
|---|---|---|
| layoutData | Byte[] |
An array of bytes that contains the tree list’s layout data.
|
| Type | Description |
|---|---|
| Boolean |
true, if the tree list’s layout has been successfully loaded; otherwise, false.
|
Use the LoadClientLayout property to restore the ASPxTreeList layout.
To save a ASPxTreeList layout, use the ASPxTreeList.SaveClientLayout method. You can specify what information on the layout can be saved, by using options provided by the ASPxTreeList.SettingsCookies property.
This example shows how to manually save and restore the previously saved layout. When the Save Layout or Load Layout button is clicked, the tree list’s client ASPxClientTreeList.PerformCallback method is used to send a callback to the server. This generates the server-side ASPxTreeList.CustomCallback event, which is handled to save or restore the tree list’s layout.
protected void ASPxTreeList1_CustomCallback(object sender,
DevExpress.Web.ASPxTreeList.TreeListCustomCallbackEventArgs e) {
if (e.Parameters == "save") {
SaveUserLayoutToDatabase("userID", "TreeListLayout", ASPxTreeList1.SaveClientLayout());
}
if (e.Parameters == "load") {
ASPxTreeList1.LoadClientLayout(GetUserLayoutFromDatabase("userID", "TreeListLayout"));
}
}
Protected Sub ASPxTreeList1_CustomCallback(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxTreeList.TreeListCustomCallbackEventArgs)
If e.Parameters = "save" Then
SaveUserLayoutToDatabase("userID", "TreeListLayout", ASPxTreeList1.SaveClientLayout())
End If
If e.Parameters = "load" Then
ASPxTreeList1.LoadClientLayout(GetUserLayoutFromDatabase("userID", "TreeListLayout"))
End If
End Sub
See Also