Back to Devexpress

Binding to a Data Source Using 'LINQ to SQL Classes'

wpf-115626-controls-and-libraries-pivot-grid-binding-to-data-database-server-mode-binding-to-server-mode-datasources-binding-to-a-data-source-using-linq-to-sql-classes.md

latest1.6 KB
Original Source

Binding to a Data Source Using 'LINQ to SQL Classes'

  • Aug 10, 2023
  • 2 minutes to read

The PivotGridControl automatically operates in server mode if it is bound to appropriate supported data source. You can use dedicated data sources tailored to work with ‘LINQ to SQL Classes’. This example shows how to use LINQ query providers.

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.

Binding the Pivot Grid control to the LinqServerModeDataSource component

  1. Create a new instance of the LinqServerModeDataSource class. Specify the type of objects retrieved from a data source LinqServerModeDataSource.KeyExpression and LinqServerModeDataSource.QueryableSource properties. Finally, bind the Pivot Grid control to the LinqServerModeDataSource component.

See Also

Binding to a Data Source Using Entity Framework