Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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]Getting Started
   [Expand]Binding to Data
   [Expand]Grid View
   [Expand]View Technology
   [Expand]Grouping
   [Expand]Sorting
   [Expand]Summaries
   [Expand]Data Editing
   [Expand]Filtering and Locating Rows
   [Expand]Focus and Selection Handling
   [Expand]Processing Rows
   [Expand]Formatting Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Expand]Appearance and Conditional Formatting
   [Expand]Batch Modifications
   [Expand]Hit Information
   [Expand]Hints
   [Expand]Popup Menus
   [Collapse]Saving and Restoring Layouts
     Member Table: Save and Restore Layout
     Saving the Layout at Design Time
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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.

How would you rate this topic?​​​​​​​