PivotGridControl.DataSource Property

Gets or sets the object used as the data source for the current control.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v20.1.dll

Declaration

[DefaultValue(null)]
public object DataSource { get; set; }
<DefaultValue(Nothing)>
Public Property DataSource As Object

Property Value

Type Default Description
Object

null

The object used as the data source.

Remarks

Objects such as a DataTable, a DataView, a IList, a IListSource and IBindingList can be used as data sources.

If some of the data source field values are custom objects (not numeric or string values), use the PivotGridOptionsData.CustomObjectConverter property to specify a serializer to be used to process them. Otherwise, you will be unable to save/restore the Pivot Grid Control layout and data to/from a file or stream.

Assigning a new value to the PivotGridControl.DataMember or DataSource property raises the PivotGridControl.DataSourceChanged event, and causes a Pivot Grid Control update. The Pivot Grid Control is not updated automatically when the current data source is modified. To force the Pivot Grid Control update, use the PivotGridControl.RefreshData method.

NOTE

The PivotGridControl.DataSourceChanged event is raised and the Pivot Grid Control is updated when the data source implementing the IBindingList interface raises the ListChanged event of the PropertyDescriptorAdded, PropertyDescriptorDeleted, PropertyDescriptorChanged or Reset type.

To retrieve data from a data source asynchronously, assign it using the PivotGridControl.SetDataSourceAsync method instead of the DataSource property.

To learn more on data binding, see Binding to Data.

Implements

DevExpress.Data.IDataContainerBase.DataSource
See Also