FlexPivot allows you to filter and display a specified set of data as per the applied filter. When you apply the value filter, it allows you to check specific values in a list. For example, let's say a user wants to view the extended prices of four products, Chai, Chang, Geitost, and Ikura offered by the salespersons in all the countries listed under the Invoices view of the C1NWind database. For this, the user needs to slice the Product Name field in the database using value filters as shown in the image below.
FlexPivot allows you to filter the data in a field from the Drag fields between areas below section of the panel at runtime. Follow the steps given below to apply value filtering in the FlexPivot control for the scenario discussed above. This implementation uses the sample created in Quick Start topic.
To apply the value filter programmatically for the above discussed scenario using the C1FlexPivotFilter class, use the following code:
C# |
Copy Code
|
---|---|
//Apply value filter to show only a few products C1.FlexPivot.C1FlexPivotFilter valuefilter = fpEngine.Fields["ProductName"].Filter; valuefilter.Clear(); valuefilter.ShowValues = "Chai,Chang,Geitost,Ikura".Split(','); |