Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]ASP.NET WebForms Controls
 [Collapse]ASP.NET MVC Extensions
  [Expand]Product Information
  [Expand]Getting Started
  [Expand]Common Concepts
  [Collapse]Grid View
    Overview - GridView
    Main Features - GridView
   [Collapse]Concepts
    [Collapse]Binding to Data
      Binding to Data via Entity Framework (Code First)
      Binding to Data via Entity Framework or LINQ to SQL (Database First)
      Binding to Large Data (Database Server Mode)
     [Expand]Custom Data Binding
    [Expand]Data Representation Basics
    [Expand]Focus and Navigation
    [Expand]Data Editing and Validation
    [Expand]Export Overview
   [Expand]Visual Elements
   [Expand]Examples
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]HTML Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Navigation and Layout Extensions
  [Expand]File Management
  [Expand]Multi-Use Site Extensions
  [Expand]Charts
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Tree List
  [Expand]Data Editor Extensions
  [Expand]Report Extensions
  [Expand]SpellChecker
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET 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]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Binding to Large Data (Database Server Mode)

Expanded Database Server Mode Overview

The MVC GridView extension supports a specific binding mode designed to work with large datasets. Within this binding mode, data-aware operations (sorting, grouping, etc.) are performed on the database server side, which is why this mode is called database server mode.

In database server mode, the MVC GridView is bound to a queryable source via the GridViewExtension.BindToLINQ method, which allows the GridView to load data from the queryable source on demand.

When an end-user performs data operations (sorting, grouping, etc.), the GridView generates smart queries to receive only those records that must be displayed on screen. These requests are passed to the associated queryable source. The queryable source translates these requests into the required queries and executes them. This ensures a quick response and improved performance for large data sources.

For end-users, the MVC GridView functions identically in regular and server modes. In database server mode, end-users can use an automatic filtering feature to access a particular data range, sort, group and filter data, calculate summaries, etc.

Expanded Binding to Data

Perform the following steps to bind the GridView to a data source in database server mode.

  1. Add the GridView to your project

    Add the GridView to your project, and bind it to a data source in regular mode using the Code First development approach or Database First development approach.

  2. Change the View code

    In the grid's View code, use the GridViewExtension.BindToLINQ method to bind the GridView to a data source. This enables binding to data in database server mode.

    Partial View code ("_GridViewPartial.cshtml"):

    Note

    Enable the GridViewSettings.EnableRowsCache option to reduce the number of calls to a bound data source when the GridView functions in Database Server Mode. When the GridView extension functions in regular data binding mode, the GridViewSettings.EnableRowsCache should be disabled.

  3. Change the Controller code

    The code sample below demonstrates the Controller code with actions that handle callbacks related to creating, reading, updating, and deleting records within the GridView using the Entity Framework ORM.

    Controller code ("HomeController.cs"):

Expanded Server mode limitations

In server mode, the MVC GridView does not have simultaneous access to bound data in its entirety. This imposes some limitations on the grid's features that are still available in regular binding mode. Please see the table below for information on features that have limitations in server mode:

Expanded See Also

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