ComponentOne FlexPivot for WinForms
Quick Start: FlexPivot for WinForms / Using FlexPivot Controls with Data Source / Binding FlexPivot to Data Source at Design-Time
In This Topic
    Binding FlexPivot to Data Source at Design-Time
    In This Topic

    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 FlexPivotPage control icon.
    3. Double-click or drag-and-drop the FlexPivotPage icon to the Form.
    4. The FlexPivotPage control docks to fill the form in the designer as shown in the image below.

      BindFlexPivotDesign

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

      Smarttag_pivotpage

    6. Click the drop-down menu appearing against the Choose Data Source option in the FlexPivotPage 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.

      BindFlexPivotDesign

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

      BindFlexPivotDesign

    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.

      BindFlexPivotDesign

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

      BindFlexPivotDesign

    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.

      BindFlexPivotDesign

    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.

    Note: WinForms .NET Edition does not include rich design-time support yet. We will enhance it in future releases.