Log In
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Chart Control
  [Collapse]Grid View
   [Expand]Product Information
    Getting Started
    [Collapse]Binding to Data
      Connecting ASPxGridView to a Data Source
     [Collapse]Binding to Large Data (Database Server Mode)
       Data Binding to Large Data via EF
       Data Binding to Large Data via LINQ
       Data Binding to Large Data via XPO
       Database Server Mode Limitations
      Built-in Row Caching
    [Expand]Data Representation Basics
    [Expand]Focus and Navigation
    [Expand]Data Editing
    [Expand]Data Shaping and Manipulation
    [Expand]Data Formatting
    [Expand]Master-Detail Relationship
     Appearance Customization
     Save and Restore Layout
    ASPxGridView Designer
   [Expand]Visual Elements
   [Expand]Member Tables
   [Expand]ASPxGridView - Animated Images
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[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]Report Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Data Binding to Large Data via EF

The ASPxGridView control supports binding to large data sets via the EntityServerModeDataSource component. This component fully supports database server mode (i.e., it delegates all data processing to the DB server), and loads the minimum required amount of records to be displayed on the screen. This allows you to dramatically increase performance when working with large datasets.

Server mode can be enabled for any Entity Framework (EF) Data Model. The EntityServerModeDataSource component is designed for ASP.NET applications, and serves as the data source for the ASPxGridView control.

When an end-user performs data operations - sorting, grouping, etc., the EntityServerModeDataSource component analyzes the grid's current state and generates smart queries to receive only those records that must be displayed on-screen. These requests are passed to the associated EF Data Model. The EF Data Model translates them into the required queries and executes them.


The EntityServerModeDataSource component is a read-only data source, starting with the Entity Framework version 4.1 and above, because it provides DbContext, as opposed to ObjectContext that was in version 4.0 and older. Thus, using the Entity Framework version 4.1 and above, you cannot perform data editing, inserting and deleting via the built-in ASPxGridView functionality.
To enable data modification operations, you need to handle the corresponding ASPxGridView events manually (ASPxGridView.RowUpdating, ASPxGridView.RowInserting, and ASPxGridView.RowDeleting respectively). To learn how to handle these events, see the following KB article - How to implement common scenarios when using ASPxGridView bound with EntityDataSource / Entity Framework - Manual CRUD operations topic.

Expanded Example

The EntityServerModeDataSource component allows you to bind ASPxGridView to the ADO.NET Entity Data Model and enable database server mode.

Expanded Create Data Classes

  1. Add the ADO.NET Entity Data Model.

  2. Follow the wizard's steps to generate a new data model using the code-first or database-first development approach.

  3. Save the generated model, close the EDMX diagram, and build the solution.

Expanded Connect to the Data Model using the EntityServerModeDataSource control

  1. Drag the EntityServerModeDataSource component and drop it onto the Page.
  2. Specify the data context type name using the EntityServerModeDataSource.ContextTypeName property.

  3. Specify the data table name using the EntityServerModeDataSource.TableName property.

  4. Bind the ASPxGridView control to the EntityServerModeDataSource component and specify the grid's ASPxGridBase.KeyFieldName property.

Expanded Database Server Mode Limitations

In database server mode, ASPxGridView does not have simultaneous access to bound data in its entirety. This imposes some limitations on the grid's features, which are still available in regular binding mode. Please see the following topic for information on features that are not supported in server mode: Database Server Mode Limitations.

Expanded See Also

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