Skip to main content

Large Data Sources: Server and Instant Feedback Modes

  • 6 minutes to read

Run Demo: Server Mode Run Demo: Instant Feedback UI Run Demo: 100 000+ Records

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 user’s configuration, and data shaping operations (sorting, grouping, or filtering) may cause a bottleneck.

LargeDataSources_DefaultModeMemoryResult

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 and Next buttons, with page numbers in between, 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 Mode.

LargeDataSources_ServerModeMemoryResult

Server mode includes two separate modes:

  • Regular (synchronous) server mode locks the GUI and does not respond to end-user actions when data is retrieved.
  • 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.

Important

Since in both modes data shaping operations (filter, group, sort, etc.) are carried out on the server side, make sure the server supports these operations.

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 that ship as part of the eXpress Persistent Objects (XPO) library, or use dedicated data sources tailored to work with ‘LINQ to SQL Classes’.

The following table lists available Server Mode sources. All data sources except XPServerCollectionSource (with the enabled AllowEdit option) are read only.

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

Do not use the BindingSource component to bind to data. Otherwise, all data is loaded into memory and Server Modes are rendered useless.

Infinite Scrolling - Virtual (Event-Based) Server Mode

In addition to the 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. Infinite Scrolling successfully replaces data pagination used in data-aware controls from other vendors.

InfiniteScrolling2.gif

Run Demo: Infinite Scrolling

How to Implement Pagination - WinForms Data Grid

Feature Limitations and Specifics

In server mode, 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 available in a regular binding mode. Please see below for information on features that are not supported or recommended in server mode.

Non-supported Features

Note

Lookup columns can be bound to one data field but display text from another data field. Set the FieldNameSortGroup property to a data field with text values to sort lookup column values by display text in Server data binding modes.

General Specifics

  • When you use the Find Panel to search for data, 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 uppercase text.

    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.

Examples

See Also