XPO Data Source
- 2 minutes to read
The Data Source Configuration Wizard allows you to bind the PivotGridControl to an XPO data source. This topic goes over the steps needed to do this.
Click the Data Source Wizard button placed on the PivotGridControl or use the corresponding command in the control’s smart tag.
In the invoked Data Source Configuration Wizard, select DevExpress ORM Tool (XPO)…
… and click the New Data Source button placed within the Data Sources area.
The following message will appear.
Click OK.
On the next page, you can generate persistent objects using the ORM Data Model Wizard or you can create persistent objects manually. Select the required option, specify the object name and click Add.
To learn how to work with XPO, see eXpress Persistent Objects.
Important
After you created a data model, rebuild the solution.
After creating a data model, click the Data Source Wizard button again.
In the invoked Data Source Configuration Wizard, select the created data model.
Click Next.
On the next page, select the required binding method.
- Binding via the XPCollection Component - Bind to data using the XPCollection component that is a collection of persistent objects.
- Binding via the XPView Component - Bind to data using the XPView component that is only intended for displaying data.
- Server Side Data Processing - Bind to data using server mode. In this case, all data processing is delegated to the database server.
Select Binding via the XPCollection Component and click Next.
On the final page, you can specify the table.
Select the required table and click Finish.
The PivotGridControl will be bound to the created XPCollection.
You can now use the Retrieve Fiels command to retrieve the available data source fields. As an alternative, you can add specific fields manually using the PivotGrid Designer. To do this, use the Run Designer… command.
Important
To initialize the database connection for the created data model, do one of the following.
- If you used the ORM Data Model Wizard to create a data model, call the ConnectionHelper.Connect method in the application’s Main method.
- If you did not use the wizard, then manually connect to a data base instead of calling ConnectionHelper.Connect.