Large Data Sources: Server and Instant Feedback Modes
- 5 minutes to read
- What are Server Modes?
- Feature Limitations and Specifics
- Server Mode Data Sources
- Infinite Scrolling - Virtual (Event-Based) Server Mode
- Data Stores Supported in Server Mode When Using XPO
- Server Mode: Binding to a Data Source Using eXpress Persistent Objects
Demos (links require the DevExpress Demo Center of version 16.2 or newer to be installed)
- Tutorial: Large Data Sources and Instant Feedback with Server Mode
- How to: Bind a GridControl to a Database in Server Mode
- How to: Reload Data from the Bound Database in Server Mode (XPO)
What are Server Modes?
In regular data binding modes, a Data Grid 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 Data Grid performance depends on a customer's rig, and data shaping operations (sorting, grouping or filtering) may cause a bottleneck.
Server modes address this issue by loading data in small portions on demand and carrying out all data shaping operations server side.
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 the list below for information on features that are not supported/not recommended in server mode.
- Adding/deleting records from the Grid Control when data is grouped.
- Sorting, grouping and filtering data by displayed values (not by editing values).
- Data searching in the Find Panel against columns whose data type is neither string nor numeric.
When searching using the Find Panel, the grid always converts a search string to lower-case. Thus, when binding the Grid Control 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.
- Filtering rows using the ColumnView.CustomRowFilter event.
- Adding custom items to the Filter Dropdown list in Instant Feedback mode.
- Custom sorting using the ColumnView.CustomColumnSort event.
- Custom grouping using the GridView.CustomColumnGroup event.
- Merged grouping in all server-aware data sources, except for XPServerCollectionSource and XPInstantFeedbackSource.
- Group intervals (GridColumn.GroupInterval) when binding with WcfInstantFeedbackSource and WcfServerModeSource.
- In Instant Feedback mode, the maximum number of visible data groups is limited to 10000.
- Calculating custom summaries using the GridView.CustomSummaryCalculate event.
- Sorting, grouping, filtering and summary calculation for unbound columns whose values are provided with the ColumnView.CustomUnboundColumnData event. These features are still supported for unbound columns that are populated using expressions (see GridColumn.UnboundExpression).
- Master-detail mode.
- Preserving the position of the focused row when data is grouped or sorted.
- Preserving row selection when data is sorted, grouped or filtered.
- WcfInstantFeedbackSource and WcfServerModeSource do not support compound keys.
- 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.
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|
|eXpress Persistent Objects||XPServerCollectionSource||XPInstantFeedbackSource|
|LINQ to SQL||LinqServerModeSource||LinqInstantFeedbackSource|
|Parallel LINQ to Objects||PLinqServerModeSource||PLinqInstantFeedbackSource|
|WCF Data Services||WcfServerModeSource||WcfInstantFeedbackSource|
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 implement the batch data loading. A Data Grid bound to this data source component supports the Infinite Scrolling feature.
Refer to the Infinite Scrolling demo for an example.