Large Data Sources: Server and Instant Feedback Modes

  • 5 minutes to read

Documentation

Demos (links require the DevExpress Demo Center of version 16.2 or newer to be installed)

Examples

What are Server Modes?

In regular data binding modes, a data-aware control loads an entire data set at once, which, in cases of large data volumes, significantly slows down application startup and consumes a considerable amount of memory. The overall application performance depends on a customer's rig, and data shaping operations (sorting, grouping or filtering) may cause a bottleneck.

LargeDataSources_DefaulModeMemoryResult

The primitive way to deal with this issue is to implement pagination, that is, to split a data set into discrete portions and display Previous, page numbers and Next buttons to switch between records. DevExpress Data Grid offers a more elegant solution that allows you to navigate between data portions on demand without any navigation buttons, and carry out all data shaping operations on the server side - Server Modes.

LargeDataSources_ServerModeMemoryResult

The "server modes" term includes two separate modes:

  • a regular (synchronous) server mode locks the GUI and does not respond to end-users' actions when data is retrieved;
  • an Instant Feedback mode (asynchronous server mode) loads data in a background thread, so that the GUI remains responsive in the process. This mode is not supported in the GridLookUpEdit control.

Feature Limitations and Specifics

In server modes, grid controls (GridControl, GridLookUpEdit, and SearchLookUpEdit) do not have simultaneous access to bound data in its entirety. This imposes certain limitations on the grid's features that are still available in a regular binding mode. Please see below for information on features that are not supported/not recommended in server mode.

Non-supported Features

General Specifics

  • When you search via the Find Panel, the grid always converts a search string to lower-case. Thus, when the Grid Control is bound to a case-sensitive data source, data search results do not contain target entries that have text in upper case.

    You can overcome this issue by using a case-insensitive data source. See the following article to learn more: How to make the Grid's filter case- and accent-insensitive in Server Mode.

  • In Instant Feedback mode, the maximum number of visible data groups is limited to 10000.
  • The server mode data source may be reloaded after changes to the underlying database. For instance, known scenarios include, but are not limited to: database changes caused by an external process, changes resulting from the code in the same process, in place editing, etc.
  • Actions that involve operating on all Data Grid rows should be avoided since processing every row sends an individual query to a SQL server. Thus, performing such actions may cause severe performance issues and UI freezes. The actions that most negatively affect Data Grid performance are expanding all group rows (GridOptionsBehavior.AutoExpandAllGroups, GridView.ExpandAllGroups) and selecting all data records (GridView.SelectAll).

Entity Framework Specifics

To learn about known issues when using Entity Framework data sources in Server Mode and how to overcome them, please refer to Entity Framework 4.0+ Server Mode Specifics.

Server Mode Data Sources

To enable a specific server mode for your data-aware control, you need to use an appropriate data source. You can use data sources provided by the eXpress Persistent Objects (XPO) library, or use dedicated data sources tailored to work with 'LINQ to SQL Classes'. Thus, choose one of the following data sources for your control.

Data Access Technology

Server Mode Data Source

Instant Feedback UI Data Source

Entity Framework 4+

EntityServerModeSource

EntityInstantFeedbackSource

XPO

XPServerCollectionSource

XPServerModeView

XPInstantFeedbackSource

XPInstantFeedbackView

LINQ to SQL

LinqServerModeSource

LinqInstantFeedbackSource

Parallel LINQ to Objects

PLinqServerModeSource

PLinqInstantFeedbackSource

WCF Data Services

WcfServerModeSource

WcfInstantFeedbackSource

OData v4

ODataServerModeSource

ODataInstantFeedbackSource

Note that you should bind to data without the BindingSource component. Otherwise, all data is loaded into memory and Server Modes are rendered useless.

Infinite Scrolling - Virtual (Event-Based) Server Mode

In addition to two "classic" data-on-demand Grid modes (Server Mode & Instant Feedback), you can use the event-based VirtualServerModeSource component to manually load large data volumes in small portions. This technique is called Infinite Scrolling, and it successfully replaces data pagination used in data-aware controls from other vendors.

InfiniteScrolling2.gif

See also: