[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
  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
  [Expand]Property Grid
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Binding to Data
   [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
   [Collapse]Examples
    [Collapse]Providing Data
      How to: Create the Fields and Bind the PivotGridControl to a Data Source
      How to: Bind a Pivot Grid to an OLAP Data Source
      How to: Bind a PivotGridControl to an OLAP Cube Using the OLE DB Data Provider
      How to: Bind a PivotGridControl to an OLAP Cube Using the ADOMD.NET Data Provider
      How to: Bind a PivotGridControl to an OLAP Cube via XMLA
      How to: Add an Unbound Field to Supply Additional Data
      How to: Add an Unbound Field to Change Axis Detailing
      How to: Provide Data for an Unbound Field Using Expressions
      How to: Save PivotGridControl Data to a File and Work with It Later
      How to: Bind a PivotGridControl to a Database at Design Time so that it Operates in Server Mode
      Server Mode with LINQ to SQL
      Server Mode with Entity Framework
    [Expand]Summarization
    [Expand]Sorting
    [Expand]Grouping
    [Expand]Filtering
    [Expand]Drill-Down (Underlying Data)
    [Expand]Editing
    [Expand]Layout Features
    [Expand]Formatting
    [Expand]Data Output
    [Expand]Appearance
    [Expand]Serialization
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Gantt Control
  [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]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]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Server Mode with LINQ to SQL

The PivotGridControl automatically operates in server mode if it is bound to the LINQ to SQL data source. This example shows how to use LINQ to SQL in the Pivot Grid application.

Expanded Creating Data Classes

  1. Add LINQ to SQL Classes to the project.

  2. Data classes can then be created and edited in an Object Relational Designer (O/R Designer). An O/R Designer provides a visual design surface for creating LINQ to SQL entity classes and relationships based on objects in a database. To learn more, see the Microsoft LINQ to SQL article.

    You can create and map entity classes to tables and views by dragging database tables and views from Server Explorer onto the O/R Designer.

    Save your changes, close the O/R Designer, and rebuild the solution.

Expanded Binding a Pivot Grid Control to the LinqServerModeSource component

  1. Drag the LinqServerModeSource component and drop it onto the Form.

    Note

    Alternatively, you can create the LinqServerModeSource (see LinqServerModeSource) in code at runtime.

  2. Specify the type of objects retrieved from a data source with the LinqServerModeSource.ElementType and LinqServerModeSource.KeyExpression properties:

  3. Specify the queryable source using the LinqServerModeSource.QueryableSource property:

  4. Bind the Pivot Grid control to the LinqServerModeSource (see LinqServerModeSource) component:

    The resulting code looks as follows:

  5. Run the project. The PivotGridControl works in server mode because it is bound to the LINQ-to-SQL data source. You can see the generated SQL statements in the Visual Studio Output window.

Note

The complete sample project Pivot Grid LINQ to SQL Server Mode Example is available in the DevExpress Examples repository.

Expanded See Also

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