Binding to a Data Source Using Entity Framework
The PivotGridControl automatically operates in server mode if it is bound to appropriate supported data source. This example illustrates how to generate model and mapping information, and how to bind the pivot grid to a data source using the Entity Framework.
Creating Data Classes
Add an ADO.NET Entity Data Model to the project.
Follow the wizard steps to generate a new data model using the code-first or database-first development approach.
- Save the generated model, close the EDMX diagram, and rebuild the solution.
Binding the Pivot Grid control to the EntityServerModeDataSource component.
Create a new instance of the EntityServerModeDataSource class. Specify the type of objects retrieved from a data source EntityServerModeDataSource.KeyExpression and EntityServerModeDataSource.QueryableSource properties. Finally, bind the Pivot Grid control to the EntityServerModeDataSource component.