You are viewing help content for pre-release software. This document and the features it describes are subject to change. Switch to the current version.

Server Mode and Instant Feedback

  • 4 minutes to read

Run Demo: Entity Framework Server Mode and Instant Feedback

Server Mode

Server mode is designed to allow you to work with large datasets. Bound data is not loaded into memory in its entirety. Instead, the GridControl loads data in small portions on demand. When the GridControl starts, it loads and displays the first portion of data from the data store. Then, as a user scrolls the grid, and reaches the last record of the loaded subset, the grid requests the data store to return a subsequent section of data. The GridControl performs all data-aware operations on the server side.

In regular data binding mode, before it's displayed within a grid control, data 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 the 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.

The GridControl automatically operates in server mode if it is bound to a data source that supports the DevExpress.Data.IListServer interface. Currently, you can use the LinqServerModeSource, XPServerCollectionSource, EntityServerModeSource or WcfServerModeSource component as a data source in server mode. These components support the IListSource interface, and return the list implementing the DevExpress.Data.IListServer interface via their List properties.

If a data source doesn't implement the DevExpress.Data.IListServer interface, server mode is not available.

Server mode cannot be used in master-detail mode.

Instant Feedback Mode

The Instant Feedback Mode is very similar in concept with the Server Mode in that data is retrieved only in portions that are required to populate the view and data-aware operations are performed on the server. Instant Feedback Mode is however an asynchronous server mode. The difference lies in how the grid behaves when data is being retrieved and populated.

When a user scrolls through the records in a Server Mode, the grid first waits for the partial data to be fetched before populating the rows. Depending on the data source performance, the volume of data being retrieved, and the network connectivity, the user may notice a considerable control freeze. Instant Feedback Mode addresses this issue by continuing to respond to the user's actions while the data is being retrieved. The user can continue to scroll through records, and even re-sort, re-group and re-filter the control's data. If required, the control will cancel the previous request and initiate a new request to the data source.

To activate this feature, use our specially designed data sources - LinqInstantFeedbackDataSource, XPInstantFeedbackSource, EntityInstantFeedbackDataSource or WcfInstantFeedbackDataSource.

To avoid thread-safety issues, all Instant Feedback data providers retrieve wrappers for objects, but not actual objects, if their AreSourceThreadSafe property is not set to false. When binding in XAML, use the Data object as shown in the code snippet below.

<Setter Property="ToolTip" Value="{Binding Path=Data.Parameter.Description}" />

You can also use a special converter - dxg:RowPropertyValueConverter, to get a value from the wrapper. See examples below.

  • RowStyle:

    <dxg:RowPropertyValueConverter x:Key="rowPropertyConverter" />
    ...
    <DataTrigger Binding="{Binding Path=DataContext, Converter={StaticResource rowPropertyConverter}, ConverterParameter=IsSeen}" Value="True">
        <Setter Property="FontWeight" Value="Bold" />
    </DataTrigger>
    
  • CellStyle/CellTemplate

    <dxg:RowPropertyValueConverter x:Key="rowPropertyConverter" /> 
    ...
    <TextBlock Text="{Binding Converter={StaticResource rowPropertyConverter}, ConverterParameter=yourPropertyName}" />
    

To provide visual feedback, the Instant Feedback binding mode also includes options to display an animation indicating the status of operations within the grid.

Property Description
DataViewBase.RowAnimationKind Specifies which animation is played while data is being asynchronously retrieved by the data source.
DataViewBase.WaitIndicatorType Specifies how asynchronous data loading operations are indicated.
DataViewBase.WaitIndicatorStyle Specifies the template that defines the wait indicator's presentation.

The grid control provides two events that fire after asynchronous data loading has been started and completed. These events are: GridControl.AsyncOperationStarted and GridControl.AsyncOperationCompleted. The GridControl.IsAsyncOperationInProgress property indicates the current status of asynchronous data loading.

NOTE

Instant feedback UI mode cannot be used in master-detail mode.

Data Access Technologies

The following table lists cross-platform components that are compatible with the GridControl. The WPF subscription also contains DataSource classes (EntityServerModeDataSource, EntityInstantFeedbackDataSource, etc.). These classes provide similar functionality, but you can add them to WPF controls in XAML.

Data Access Technology

Instant Feedback UI Data Source

Server Mode Data Source

Entity Framework 4+

EntityInstantFeedbackSource

EntityServerModeSource

eXpress Persistent Objects

XPInstantFeedbackSource

XPServerCollectionSource

OData v4

ODataInstantFeedbackSource

ODataServerModeSource

WCF Data Services

WcfInstantFeedbackSource

WcfServerModeSource

LINQ to SQL

LinqInstantFeedbackSource

LinqServerModeSource

Parallel LINQ to Objects

PLinqInstantFeedbackSource

PLinqServerModeSource

Concepts

Examples