# Multiple Values

This topic covers information about adding multiple fields in values list.

## Content

FlexPivot provides the option for adding more than one value fields to the **Values** list. All you need to do is set MaxItems property to some numeric value in the code. This example uses the sample created in [Configuring Fields in Code](/componentone/docs/win/online-flexpivot/concepts/ConfiguringFieldsinCode).

1. Set the MaxItems property to 3 and add three value fields namely Extended Price, Discount and Freight to the ValueFields.Add() method as illustrated in the following code.

    ```vbnet
    'apply multiple value fields 
    fp.ValueFields.MaxItems = 3
    fp.ValueFields.Add("ExtendedPrice", "Discount", "Freight")
    ```

    ```csharp
    //apply multiple value fields 
    fp.ValueFields.MaxItems = 3;
    fp.ValueFields.Add("ExtendedPrice", "Discount", "Freight");
    ```
2. Press **F5** to run the application and observe that Extended Price, Discount and Freight fields are displayed in the grid.
<br>
    ![multiplevaluefields](https://cdn.mescius.io/document-site-files/images/78f24d1c-0e57-452f-87a1-d318e186587a/images/multiplevaluefields.png)