[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Collapse]Grid View
   [Expand]Product Information
    Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Expand]Focus and Navigation
    [Expand]Data Editing
    [Expand]Data Shaping and Manipulation
    [Expand]Data Formatting
    [Expand]Master-Detail Relationship
     Appearance Customization
     Adaptivity
    [Collapse]Layout
      Save and Restore Layout
    [Expand]Templates
    [Expand]Export
     Toolbars
    [Expand]ASPxGridLookup
    ASPxGridView Designer
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Card View
  [Expand]Reporting
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Gauges
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Save and Restore Layout

ASPxGridView allows you to save the following layout information to a database and then restore it:

  • column visible positions;
  • grid and column width;
  • grid appearance settings;
  • filter, group, sort, and pager information.

Use the ASPxGridView.SettingsCookies property to specify which ASPxGridView layout information to save.

Expanded Save Layout Automatically

Set the ASPxGridCookiesSettings.Enabled property to true to save a grid layout to cookies automatically.

Expanded Save and Restore Layout Manually

  • The ASPxGridBase.ClientLayout event allows you to save a grid's layout each time a user changes it and restore this layout on the first page load. Use the event's ASPxClientLayoutArgs.LayoutMode property to specify whether to save or restore the grid's layout.

    Note

    The grid requires a round trip to the server (a callback) to raise the ASPxGridBase.ClientLayout event.

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

  • The following two methods enable you to save and restore the grid layout.

    This example shows how to save and restore the previously saved layout manually. The grid calls the ASPxClientGridView.PerformCallback method to send a callback to the server when a user clicks the Save Layout or Load Layout button. This generates the server-side ASPxGridView.CustomCallback event. Handle this event to save or restore the grid's layout.

Is this topic helpful?​​​​​​​