Skip to main content

IList and IEnumerable Data Sources

  • 2 minutes to read

The Items Source Configuration Wizard allows you to bind the PivotGridControl to any object that implements the IList or IEnumerable interfaces (to learn more about such objects, see Traditional Data Binding Methods). This topic guides you through the steps needed to do this.


In this topic, the data class from the following example will be used: How to: Bind a Control to Data Created at Runtime.

  1. Click the PivotGridControl’s smart tag and select the Items Source Wizard command.


  2. In the invoked Items Source Configuration Wizard, select IList/IEnumerable


    … and click Next.

  3. On the next page, select the required binding method.


    • Simple Binding - allows you to bind the PivotGridControl to a data source directly.
    • Manipulating Data via ICollectionView - allows you to bind the PivotGridControl to a data source using the ICollectionView component, which enables collections to have the functionalities of current record management, custom sorting, filtering, and grouping. To learn more, see ICollectionView Specifics.

    Select Simple Binding and click Next.

  4. On the final page, you need to specify the name of the required data class.


    Start typing the name of the data class.


    Then, select the required class from the list of classes offered by the Items Source Configuration Wizard and click Finish.

  5. The PivotGridControl will be bound to the created data source.


    You can now use the Retrieve Fields command to retrieve the available data source fields.


    Note that the Items Source Configuration Wizard adds the created data source to window resources.

            <dx:IEnumerableDataSource x:Key="IEnumerableDataSource">
                    <dx:DesignDataSettings DataObjectType="{x:Type local:Record}" RowCount="5"/>

    Then, the PivotGridControl is bound to the created data source.

    <dxpg:PivotGridControl DataSource="{Binding Data, Source={StaticResource IEnumerableDataSource}}"/>