ComponentOne FlexPivot for WinForms
Binding FlexPivot to Data Source at Design-Time
Quick Start: FlexPivot for WinForms > Using FlexPivot Controls with Data Source > Binding FlexPivot to Data Source at Design-Time

FlexPivot provides an array of default features that can be directly used without writing even a single line of code. You start by adding the FlexPivotPage control to an empty Windows Forms application and binding it to a data source using the Smart tag.

At Design-Time

  1. Create a new Windows Forms Application in Visual Studio.
  2. Navigate to the Toolbox and locate the C1FlexPivotPage control icon.
  3. Double-click or drag-and-drop the C1FlexPivotPage icon to the Form.
  4. The C1FlexPivotPage control docks to fill the form in the designer as shown in the image below.

    Design View

  5. Click the smart tag icon () appearing in the upper right corner of the C1FlexPivotPage control. The C1FlexPivotPage Tasks smart tag panel appears similar to the image below.

    Smarttag icon

  6. Click the drop-down menu appearing against the Choose Data Source option in the C1FlexPivotPage Tasks smart tag panel.
  7. Click the 'Add Project Data Source' link to open Data Source Configuration Wizard window.
  8. Select Database as the Data Source type in the Data Source Configuration Wizard window and click Next.

    Configuring Data Source

  9. Choose Dataset as the database model in the Data Source Configuration Wizard window and click Next.

    Configuring Data Source

  10. Choose data connection string for your application to connect to the database and click Next. In this example, we are using C1NWind.mdb file as the data source. This file is kept at Documents\ComponentOne Samples\Common\C1NWind.mdb location on your system.

    Configuring Data Source

  11. Save the connection string by selecting the checkbox and click Next.

    Configuring Data Source

  12. Choose database objects from the Data Source Configuration Wizard window that you want in your dataset. In this example, we are selecting Invoices view for data binding as shown in the image. Click Finish to complete the data binding.

    Configuring Data Source

  13. Press F5 to run the application. FlexPivotPage control is now connected to the C1NWind.mdb file and you can see that the control appears with various data fields available in the FlexPivotPanel.

You can now create different views by dragging the data fields to Rows, Columns and Values list for data analysis. Click here to know how to create different views.