WCF Data Services
- 2 minutes to read
The Items Source Configuration Wizard allows you to bind the PivotGridControl to data using WCF Data Services. This topic guides you through the steps needed to do this.
Click the PivotGridControl’s smart tag and select the Items Source Wizard command.
In the invoked Items Source Configuration Wizard, select WCF Data Services…
… and click the New Data Source button placed within the Data Sources area.
The following message will appear.
Click OK.
Specify the address of a data service.
To learn how to create a WCF data service, see the following topics: Creating the Data Service.
Important
After you create a service reference, rebuild the solution.
After creating a data source, click Items Source Wizard again.
In the invoked Items Source Configuration Wizard, select the created service.
Click Next.
On the next page, select the required binding method.
- Simple Binding - allows you to bind the PivotGridControl to a data source directly.
- Manipulating Data via ICollectionView - allows you to bind the PivotGridControl to a DataSet using the ICollectionView component, which enables collections to have the functionalities of current record management, custom sorting, filtering, and grouping. To learn more, see ICollectionView Specifics.
- Server Side Data Processing - allows you to bind the PivotGridControl to large data sources. To learn more, see Database Server Mode.
Select Simple Binding and click Next.
On the final page, specify the service URI (Service Root) and click the Test Connection button.
Then, select the required Table and click Finish.
The PivotGridControl will be bound to the created data source.
You can now use the Retrieve Fields command to retrieve the available data source fields.
Note
Note that the Items Source Configuration Wizard adds the created data source to window resources.
<dx:DXWindow.Resources> <dx:WcfSimpleDataSource x:Key="WcfSimpleDataSource" ContextType="{x:Type ServiceReference1:NorthwindEntities}" Path="SalesPersons" ServiceRoot="http://localhost:65455/Northwind.svc/"> </dx:WcfSimpleDataSource> </dx:DXWindow.Resources>
Then, the PivotGridControl is bound to the created data source.
<dxpg:PivotGridControl DataSource="{Binding Data, Source={StaticResource WcfSimpleDataSource}}"/>