Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Fundamentals
   [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'
      Binding to a Data Source Using WCF Server
     Unbound Fields
     Local Data Stores
     Asynchronous Mode
   [Expand]Data Shaping
   [Expand]Data Analysis
   [Expand]Layout
   [Expand]Focus and Navigation
   [Expand]Printing and Exporting
   [Expand]Appearance
   [Expand]Design-time Features
   [Expand]Miscellaneous
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Examples
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap 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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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.

Note

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

Expanded See Also

How would you rate this topic?​​​​​​​