ComponentOne FlexPivot for WinForms
FlexPivotSlicer Overview / Data Binding
In This Topic
    Data Binding
    In This Topic

    FlexPivotSlicer supports binding with a data source to display sorted, selected and filtered data. A data source can be assigned to the FlexPivotSlicer through the designer as well as code.

    Binding FlexPivotSlicer to Data Source at Design-Time

    This section highlights how to bind the FlexPivotSlicer control to a data source at design time.

    Databindingg

    Follow these steps to bind a FlexPivotSlicer to a data source:

    1. Add the FlexPivotSlicer control to your application.
    2. In the Choose Data Source option, assign an instance of the already configured FlexPivotPanel, say c1FlexPivotPanel1, as the data source.
    3. Select the FieldName that you want to filter using the Field name option. In this example, we selected CustomerID.

    Binding FlexPivotSlicer to Data Source through Code

    For binding FlexPivotSlicer control with a data source programmatically, you need to create an instance of the C1FlexPivotSlicer class, and then set the Field property of the FlexPivotSlicer control. Note that the Field must be added to one of the following collections: RowFields, ColumnFields, ValueFields, or FilterFields.

    The following code shows how you can add and configure the FlexPivotSlicer control to filter the FlexPivotGrid or FlexPivotChart data by the field ‘Country’.

     
    'Configure the FlexPivotSlicer control
    c1FlexPivotSlicer = New C1FlexPivotSlicer();
    c1FlexPivotSlicer.Field = flexPivotPage.PivotEngine.Fields("Country");
    
     
    //Configure the FlexPivotSlicer control
    c1FlexPivotSlicer = new C1FlexPivotSlicer();
    c1FlexPivotSlicer.Field = flexPivotPage.PivotEngine.Fields["Country"];
    

    You can also add multiple FlexPivotSlicer controls and bind them to the desired fields to filter the FlexPivotGrid or FlexPivotChart data by multiple fields simultaneously.

    The following GIF depicts a scenario where multiple FlexPivotSlicer controls can be configured to display the sales of food products in different countries for the last quarter (October, November, and December) within the pivot grid/pivot chart.

    MultipleSlicerFiltering

    See Also