[Expand]General Information
[Collapse]WinForms Controls
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Collapse]Data Grid
   [Expand]Get Started With Data Grid and Views
   [Expand]Data Binding
    Unbound Columns
   [Expand]Data Editing and Validation
   [Expand]Filter and Search
   [Expand]Focus and Selection Handling
    Format Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Expand]Appearance and Conditional Formatting
    Split Presentation
    Row Preview Sections
   [Expand]Batch Modifications
    Hit Information
    Popup Menus
   [Collapse]Save and Restore Layout
     Member Table: Save and Restore Layout
     Saving the Layout at Design Time
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[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]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Saving the Layout at Design Time

Expanded Saving the Layout at Design Time

Grid Control enables you to save and then restore the layouts of Views to XML files at design time. For instance, at design time you can create and customize a View, add columns/bands, arrange them in a specific order, change sorting and grouping settings, etc., and then save the layout to an XML file via the Grid Designer. You will then be able to restore this layout at design time or runtime within the current or other view, and even in another application.

To store and restore layouts at design time, use the Layout Page of the Grid Designer. This allows you to load and save a layout to an XML file. It is also possible to load the layout that has been previously saved to an XML file at runtime using the BaseView.RestoreLayoutFromXml method.

When a View's layout is saved at design time, all the settings of the View object and its columns are saved. The information that is stored is enough to replicate the current View in another empty View, so that the Views look identical. When a layout is restored at design time, all the settings that are stored in the XML file are restored. Note that settings of in-place editors of columns are not saved when the layout is saved.

At runtime, the set of options that are saved/restored using the BaseView.SaveLayoutToXml and BaseView.RestoreLayoutFromXml methods is different, by default, than the set of options that are saved/restored at design time. By default, the appearance, data-aware, behavior, customization, detail, selection and some other options are not saved/restored at runtime. To save or restore the complete set of options at runtime call the BaseView.SaveLayoutToXml or BaseView.RestoreLayoutFromXml method with the static OptionsLayoutBase.FullLayout property as the options parameter.

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