PivotFileDataSource Class

The pivot grid control's data, loaded from a file or stream.

Namespace: DevExpress.Data.PivotGrid

Assembly: DevExpress.PivotGrid.v20.1.Core.dll

Declaration

public class PivotFileDataSource :
    ITypedList,
    IList,
    ICollection,
    IEnumerable
Public Class PivotFileDataSource
    Implements ITypedList,
               IList,
               ICollection,
               IEnumerable

Remarks

The pivot grid control's data, along with the full layout can be saved to a file or stream via the PivotGridControl.SavePivotGridToFile and PivotGridControl.SavePivotGridToStream methods, respectively. The PivotFileDataSource objects are used to restore the data together with the layout, and load it to the same or another pivot grid control.

To restore the data and layout, create a PivotFileDataSource object, passing the file or stream that contains pivot grid data to the constructor, and assign the created object to pivot grid's PivotGridControl.DataSource property.

NOTE

The PivotFileDataSource is a read-only data source.

Examples

The following example shows how to save the Pivot Grid Control's data to a file, and then load it later.

To save the data the PivotGridControl.SavePivotGridToFile method is called. To restore the data, a PivotFileDataSource object is initialized and assigned to the PivotGridControl.DataSource property.

using DevExpress.Data.PivotGrid;

string filePath = "c:\\pivotData.dat";
// Save the control's data to the file.
pivotGridControl1.SavePivotGridToFile(filePath);

//...

// Restore the saved data
PivotFileDataSource ds = new PivotFileDataSource(filePath);
pivotGridControl1.DataSource = ds;

Inheritance

Object
PivotFileDataSource
See Also