WCF Data Services

  • 2 minutes to read

The Data 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.

  1. Click the Data Source Wizard button placed on the PivotGridControl or use a corresponding command in a control's smart tag.


  2. In the invoked Data Source Configuration Wizard, select WCF Data Services...


    ... and click the New Data Source button placed within the Data Sources area.


  3. The following message will appear.


    Click OK.

  4. Specify the address of a data service.


    To learn how to create a WCF data service, see the following topics: Creating the Data Service.


    After you creat a service reference, rebuild the solution.

  5. After creating a service reference, click the Data Source Wizard again.


  6. In the invoked Data Source Configuration Wizard, select the created service.


    Click Next.

  7. On the next page, select the required binding method.


    Select Direct Binding to Data Source and click Next.

  8. On the final page, specify the service URI (Service Root) and click the Test Connection button.


    Then, select the required Table and click Finish.

  9. The following code will be generated by the Data Source Configuration Wizard.

    public Form1()
                // This line of code is generated by the Data Source Configuration Wizard
                pivotGridControl1.DataSource = new WinFormsPivot.ServiceReference1.NorthwindEntities(new System.Uri("http://localhost:65455/Northwind.svc/")).SalesPersons.ToList();

    You can now work with the created data source at runtime. For instance, to retrieve fields from the connected data source, call the PivotGridControl.RetrieveFields method.