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
    [Collapse]Data Source Configuration Wizard
      ADO.NET Data
      SQL Data
      Excel Data Source
      Unbound Data Source
      Entity Framework Data
      Entity Framework (EF) Core
      LINQ to SQL
      WCF Data Services
      OData V4
      XPO Data Source
      IList and IEnumerable Data Sources
      XML Data
      OLAP Cube
      BindingSource Component Specifics
    [Expand]OLAP Data Source
    [Expand]Database Server Mode
     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

LINQ to SQL

The Data Source Configuration Wizard allows you to bind the PivotGridControl to an SQL database using LINQ to SQL at design time. This topic shows how to do this.

  1. Click the Data Source Wizard button placed on the PivotGridControl or use the corresponding command in the control's smart tag.

  2. In the invoked Data Source Configuration Wizard, select LINQ to SQL...

    ... and click the New Data Source button placed within the Data Sources area.

  3. The following message will appear.

    Click OK.

  4. Make sure that the LINQ to SQL Classes item is selected in the invoked dialog. Then, specify the required name and click Add.

    To learn how to create LINQ to SQL classes that are based on objects in a database, see the following topic: Creating LINQ to SQL Classes.

    Important

    After you creat a data model, rebuild the solution.

  5. After creating LINQ to SQL classes, click the Data Source Wizard button again.

  6. In the invoked Data Source Configuration Wizard, select the created data model.

    Click Next.

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

    Select Direct Binding to Data Source and click Next.

  8. On the final page, you can specify the table.

    Select the required table and click Finish.

  9. The following code will be generated by the Data Source Configuration Wizard.

    You can work now with the created data source at runtime. For instance, to retrieve fields from the connected data source, call the PivotGridControl.RetrieveFields method.

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