Back to Devexpress

Bind a Pivot Grid to a Server Mode Database at Design Time

windowsforms-17898-controls-and-libraries-pivot-grid-binding-to-data-server-mode-binding-to-server-mode-datasources-how-to-bind-a-pivotgridcontrol-to-a-database-at-design-time-using-server-mode.md

latest2.5 KB
Original Source

Bind a Pivot Grid to a Server Mode Database at Design Time

  • Oct 26, 2022
  • 2 minutes to read

If you need to connect a pivot grid control to a database with a large number of records, you can use server mode. The pivot grid control, if it is bound to an appropriate data source, automatically operates in server mode. You can use dedicated data sources tailored to work with ‘LINQ to SQL Classes’ or ‘Entity Framework 4+’ data access technologies.

The following example is a step-by-step guide that demonstrates how to bind a PivotGridControl to a LinqServerModeSource data source at design time using the Data Source Configuration Wizard.

This example consists of the following steps.

Launching the Data Source Configuration Wizard

  1. To invoke the Data Source Configuration Wizard , do one of the following.

  2. Select LINQ to SQL technology and click New Data Source… button.

Creating Data Classes

  1. Select the LINQ to SQL Classes item and add it 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.

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

Binding to a Data Source using ‘LINQ to SQL Classes’

  1. Invoke the Data Source Configuration Wizard again, select the LINQ to SQL technology and choose the previously created data source. Click Next.

  2. In the next window, select Server-Side Data Processing and click Next. This activates the server mode.

  3. Select a table and a key expression column, and click Finish to close the Data Source Configuration Wizard.

  4. The PivotGridControl is now bound to the LinqServerMode data source and automatically operates in server mode.