Bind Grid View to Large Data (Database Server Mode)
- 3 minutes to read
The ASPxGridView control supports a specific binding mode designed to work with large datasets. Data-aware operations (sort, group, and so on) are executed on the database server side in this mode: database server mode.
Database Server Mode vs. Regular Binding Mode
Server mode binds ASPxGridView to data with one of the following data providing components: LinqServerModeDataSource, EntityServerModeDataSource, or XpoDataSource. When a user performs data operations (such as sort or group actions), a data providing component analyzes the grid’s current state and 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.
In regular data binding mode, before data is displayed within a grid control, it must be fetched in its entirety from a data store into memory. The number of records is a bottleneck, as the more records there are, the more time is required to load that data. Moreover, the grid’s performance also depends on the total number of loaded records, particularly when data is sorted, grouped, filtered or the summary feature is used. In this case, the grid needs to process the entire recordset to implement a specific data-aware operation.
For users, ASPxGridView functions identically in regular and server modes. In server mode, users can use an automatic filter feature to access a specific data range, sort, group and filter data, calculate summaries, and more.
Database Server Mode Limitations
In database server mode, ASPxGridView does not have simultaneous access to bound data in its entirety. This imposes some limitations on the grid’s features, which are still available in regular binding mode. See the list below for information on features that are not supported in server mode:
- Filter and sort data by display text (not by edit values).
- Search with the search panel by display text.
- Case-sensitive filter - the grid converts a search string to lower-case before it filters data.
- Custom sort (ASPxGridView.CustomColumnSort) and custom group (ASPxGridView.CustomColumnGroup).
- Group modes specified by the GridViewDataColumnSettings.GroupInterval property (rows are always grouped by the values of grouping columns).
- Custom summary calculation using the ASPxGridBase.CustomSummaryCalculate event.
- Sort, group, filter, and summary calculation for unbound columns whose values are supplied by the ASPxGridView.CustomUnboundColumnData event. These features are still supported for unbound columns that are populated with expressions (see GridViewDataColumn.UnboundExpression).
- Selection of all grid rows using the built-in SelectAll check box (when the GridViewCommandColumn.SelectAllCheckboxMode property is set to AllPages).