[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Collapse]Binding to Data
     Binding to Data Overview
    [Expand]Items Source Configuration Wizard
    [Expand]OLAP Data Source
    [Expand]Database Server Mode
     Unbound Fields
     Optimized Mode and Data Binding API
     Local Data Stores
     Asynchronous Mode
   [Expand]Data Shaping
   [Expand]Data Analysis
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]MVVM Enhancements
   [Expand]UI Elements
   [Expand]End-User Capabilities
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[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)

Local Data Stores

Sometimes end-users need to work with PivotGridControl when no connection to the database exists. Whenever a connection to the database exists, an end-user can save the Pivot Grid Control's data to a file or stream. Then, when the connection isn't available, it is possible to load the saved data and continue working with the PivotGridControl.

Expanded Creating and Using Local Data Stores

The PivotGridControl.SavePivotGridToFile method saves Pivot Grid Control's current data to a file for later use (if required, you can save the data to a stream using the PivotGridControl.SavePivotGridToStream method). These methods save all the original data from the data store, together with the full layout, including appearance settings. It is possible to set the method's compress parameter to true to enable data compression. This will reduce the size of the resulting file, but may increase the time required for data saving/loading.

To load saved data, a PivotFileDataSource object must be created and assigned to the PivotGridControl.DataSource property. This automatically restores the layout portion from the specified file and loads the saved data. After data has been restored, an end-user is able to manipulate the Pivot Grid Control's layout, sort and filter data, etc.


A PivotFileDataSource object can be created using the constructor that takes a System.IO.Stream object as a parameter. In this instance, do not dispose of the specified stream until the PivotFileDataSource object is assigned to the PivotGridControl.DataSource property.


Typically, you save and restore data in the same control. However, it is possible to restore saved data in another PivotGridControl. In this instance, custom logic implemented in the first Pivot Grid Control in code will not be available in the second control. For example, unbound fields that are populated using the PivotGridControl.CustomUnboundFieldData event will not provide any data in the second PivotGridControl.

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