Database Server Mode
- 3 minutes to read
If you need to connect a PivotGridControl to a database with a large number of records, you can use server mode. Server mode has been specifically designed to work with large datasets (the specific amount of data depends on your circumstances). In this mode, the pivot grid control performs data-aware operations on the database server side. That ensures quick access to data, even if grouping and filtering are used.
For end-users, the pivot grid control functions identically in regular and server modes. In server mode, they can scroll the pivot grid, sort, group and filter data, and calculate summaries.
The Pivot Grid control can perform data-aware operations (retrieving data from the server, grouping, filtering data and calculating summaries) in a background thread, allowing the entire application to stay responsive while these operations are in progress. To enable asynchronous mode, set the PivotGridControl.UseAsyncMode property to true.
Server Mode Data Sources
The PivotGridControl automatically operates in server mode if it is bound to appropriate supported data source. Use one of the following data sources to enable this mode.
Data Access Technology | Server Mode Data Source |
---|---|
Entity Framework 4+ | EntityServerModeDataSource |
LINQ to SQL | LinqServerModeDataSource |
Note
The EntityServerModeDataSource and LinqServerModeDataSource are read-only data sources.
Bind the Pivot Grid to Data in Server Mode
Topics in this section describe how to connect the Pivot Grid to server mode data sources and populate Pivot Grid fields with data.
Binding to a Data Source Using Entity Framework
This example demonstrates how to generate model and mapping information, and how to bind the pivot grid to the data source using Entity Framework.
Binding to a Data Source Using ‘LINQ to SQL Classes’
This example shows how to use LINQ query providers.
Bind Pivot Grid Fields to Calculated Expressions
This topic describes how to use the Binding API to bind a Pivot Grid field to a data source column in Server mode.
Bind Pivot Grid Fields to Data Columns
This topic describes how to use the Binding API to create calculated fields.
Server Mode Limitations
Server mode is not supported when the Pivot Grid uses the Optimized calculation because this engine calculates data on the client side.
In server mode, the pivot grid control doesn’t have simultaneous access to bound data in its entirety and this imposes some limitations on the pivot grid’s features. See the list below for information on features that are not supported in a server mode.
- Custom summaries calculated using the PivotGridControl.CustomSummary event.
- Custom grouping is not supported using the PivotGridControl.CustomGroupInterval event.
- Custom sorting is supported using the PivotGridControl.CustomServerModeSort event.
- Providing data for unbound fields using PivotGridControl.CustomUnboundFieldData event.