This example shows how to save or restore the ASPxCardView layout to or from a data store.
C# |
protected void CardView_ClientLayout(object sender, ASPxClientLayoutArgs e)
{
if (e.LayoutMode == DevExpress.Web.ClientLayoutMode.Saving)
{
SaveUserLayoutToDatabase(userID, "Account", e.LayoutData);
}
else
{
if (System.IO.File.Exists(fileName))
e.LayoutData = RestoreUserLayoutFromDatabase(userID, "Account");
}
}
|
This example shows how to manually save and restore the previously saved layout. When the Save Layout or Load Layout button is clicked, the grid's ASPxClientCardView.PerformCallback client method is used to send a callback to the server. This generates the server-side ASPxCardView.CustomCallback event, which is handled to save or restore the grid's layout.
C# |
protected void ASPxCardView1_CustomCallback(object sender, ASPxCardViewCustomCallbackEventArgs e)
{
if (e.Parameters == "save") {
SaveUserLayoutToDatabase("userID", "Layout", ASPxCardView1.SaveClientLayout());
}
if (e.Parameters == "load") {
ASPxCardView1.LoadClientLayout(GetUserLayoutFromDatabase("userID", "Layout"));
}
|