windowsforms-8398-controls-and-libraries-data-grid-data-binding-large-data-sources-server-and-instant-feedback-modes.md
Run Demo: Server Mode Run Demo: Instant Feedback UI Run Demo: 100 000+ Records
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.
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.
Server mode includes two separate modes:
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.
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+
|
|
| |
XPO
|
|
| |
LINQ to SQL
|
|
| |
Parallel LINQ to Objects
|
|
| |
WCF Data Services
|
|
| |
OData v4
|
|
|
Note
Do not use the BindingSource component to bind to data. Otherwise, all data is loaded into memory and Server Modes are rendered useless.
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.
How to Implement Pagination - WinForms Data Grid
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.
CustomSummaryProcess parameter returns “Finalize”.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.
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.
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).
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.
See Also