Skip to content

The following example demonstrates how to bind the Pivot Grid control to a SalesPerson view in the nwind.mdb database included with the installation.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/wpf-pivot-grid-bind-to-an-mdb-database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pivot Grid for WPF - Bind a PivotGrid to an MS Access Database at Runtime

The following example demonstrates how to bind the Pivot Grid control to a SalesPerson view in the nwind.mdb database included with the installation.

Files to Review

Example Overview

Follow the steps below to connect the Pivot Grid to a database.

  1. Create an OleDbConnection object and specify the connection string in its constructor.
  2. Create an OleDbDataAdapter instance to select records from the data source.
  3. Create a new DataSet object and populate it with data.
  4. Use the PivotGridControl.DataSource property to assign the resulting data source to the Pivot Grid.

Follow the steps below to create and configure Pivot Grid fields.

  1. Create a PivotGridField object and add it to the PivotGridControl.Fields collection.
  2. Specify the field’s area and position within this area. For this, use the PivotGridFieldBase.Area and PivotGridField.AreaIndex properties. AreaIndex can be set only after the field is added to the control’s field collection.
  3. Create a DataSourceColumnBinding object for each field.
  4. Set the DataSourceColumnBindingBase.ColumnName property to the name of the column in the data source. The Pivot Grid fields obtain their values from columns in the data source.
  5. Assign the DataSourceColumnBinding object to the field’s PivotGridFieldBase.DataBinding property.

Documentation

About

The following example demonstrates how to bind the Pivot Grid control to a SalesPerson view in the nwind.mdb database included with the installation.

Topics

Resources

License

Stars

Watchers

Forks