FlexPivot for WinForms
データ連結
FlexPivotSlicer の概要 > データ連結

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’.

 
'FlexPivotSlicerコントロールを構成します
c1FlexPivotSlicer = New C1FlexPivotSlicer();
c1FlexPivotSlicer.Field = flexPivotPage.PivotEngine.Fields("Country");
 
//FlexPivotSlicerコントロールを構成します
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

関連トピック