[Expand]General Information
[Collapse]WinForms Controls
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Collapse]Binding to Data
     Binding to Data Overview
    [Expand]Data Source Configuration Wizard
    [Expand]OLAP Data Source
    [Collapse]Database Server Mode
      Binding to a Data Source Using Entity Framework
      Binding to a Data Source Using 'LINQ to SQL Classes'
     Unbound Fields
     Local Data Stores
     Asynchronous Mode
   [Expand]Data Shaping
   [Expand]Data Analysis
   [Expand]Focus and Navigation
   [Expand]Printing and Exporting
   [Expand]Design-Time Features
   [Expand]UI Elements
   [Expand]End-User Capabilities
  [Expand]Member Tables
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

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 demonstrates how to generate model and mapping information, and bind the pivot grid to the data source using the Entity Framework.

Creating Data Classes

  • Add ADO.NET Entity Data Model to the project.

  • Create a model in the EF Designer based on an existing database. You can choose the database connection, settings for the model, and database objects to include in the model. The classes your application will interact with are generated from the model.

    You can specify the model by dragging database tables and views from Server Explorer to the model.

    Save your changes and rebuild the solution.

Binding a Pivot Grid Control to the EntityServerModeSource component

  • Drag the EntityServerModeSource component and drop it onto the Form.

  • Specify the type of objects retrieved from a data source using the EntityServerModeSource.ElementType and EntityServerModeSource.KeyExpression properties.

  • Specify the queryable source with the EntityServerModeSource.QueryableSource property. This property must be set in code.

  • Bind the Pivot Grid control to the EntityServerModeSource component.


To learn how to bind the PivotGridControl to data using the Data Source Configuration Wizard, see the Entity Framework Data tutorial.

Expanded See Also

Is this topic helpful?​​​​​​​