Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Collapse]Data Grid
   [Collapse]Getting Started
    [Collapse]Walkthroughs
     [Expand]Appearance and Conditional Formatting
     [Expand]Data Editing
     [Expand]Hit Information
     [Collapse]Data Binding and Working with Columns
       Tutorial: ADO.NET Data
       Tutorial: Working with Columns in Code
       Tutorial: Unbound Columns
       Tutorial: Create and Manage Columns at Design Time
       Tutorial: Entity Framework Data
       Tutorial: Create and Manage Data in Code and Apply Data Annotation Attributes
       Tutorial: Large Data Sources and Instant Feedback with Server Mode
     [Expand]Grid View - Columns, Rows and Cells
     [Expand]Banded Views
     [Expand]WinExplorer View
     [Expand]Tile View
     [Expand]Grouping
     [Expand]Filter and Search
     [Expand]Sorting
     [Expand]Summaries
     [Expand]Split Presentation
     [Expand]Row Preview Sections
     Data Grid and Views
   [Expand]Data Binding
   [Expand]Views
   [Expand]Data Editing and Validation
   [Expand]Grouping
   [Expand]Sorting
   [Expand]Filter and Search
   [Expand]Summaries
   [Expand]Focus and Selection Handling
    Formatting Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Expand]Appearance and Conditional Formatting
    Split Presentation
    Row Preview Sections
    Scrolling
   [Expand]Batch Modifications
   [Expand]Hit Information
    Hints
   [Expand]Popup Menus
   [Expand]Saving and Restoring Layouts
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Tutorial: Large Data Sources and Instant Feedback with Server Mode

This walkthrough is a transcript of the Large Data Sources and Instant Feedback with Server Mode video available on the DevExpress YouTube Channel.

The tutorial first describes the disadvantages of the standard data binding mode when handling very large data sources. You will learn how to use Server Mode data binding to address initial data loading and data manipulation performance. Finally, the walkthrough will demonstrate the Instant Feedback data binding mode that ensures that your application's UI never freezes by performing data-related operations in a background thread.

Expanded Default Mode

In the sample application, the grid is bound to a data source with 100,000 rows using the default data binding mode. In this mode, the grid will load all data into the memory and will then manipulate this data in response to end-user action.

Run the app to analyze the grid's performance. The grid will load all the records into memory, meaning increased memory consumption and delayed application startup. You can already see startup takes a very long time. As you can see in the task manager, the app is actually running and already consumes about 220 megabytes of memory.

To check the application status, click Break All. As you can see, the data source is still being populated. Click Continue and wait. After the application has finally started, 100000 records are displayed.

Data operations will all be performed by the grid control on the client machine. So the performance will depend on the client computer. You can see that even on a fast computer data grouping and sorting are performed with noticeable lags.

Expanded Server Mode

Now close the application and switch to the Server Mode data binding to improve the application's performance. In this data binding mode, the grid control will request only a portion of data that is to be displayed on screen. Data shaping operations will be carried out by the server.

Remove the code and the BindingSource component that were previously added by Data Source Configuration Wizard. Then, invoke the grid control's smart tag and click the Data Source Wizard link.

Choose the Entity Framework technology and select the existing data connection.

On the next page, select Server-Side Data Processing and click Next.

Finally, select the desired table, key expression and default sorting.

Now launch the app to see the result. Remember that in Server Mode, the grid will only request a few records to be displayed on screen, which means reduced memory consumption and faster application startup. This time, the application started in a few seconds. At the same time, you are able to access all 100,000 records. Scroll the View to see that there are practically no lags.

Grouping and sorting and filtering also work quickly. Data operations work fast, because after each end-user action, the grid sends a request for updated data to the server. The server will usually execute these operations much faster and then only a few visible records are returned to the grid. This mean that you have access to all records and are free to apply any data shaping operations you want.

If you check the Task Manager, you'll see that memory consumption is reduced greatly compared to the standard mode.

Close the application to try one more data binding mode designed to handle large data sources.

Expanded Instant Feedback Mode

The currently applied data binding mode is synchronous. This means that the user interface freezes momentarily while the grid waits for updated data from the server. The DevExpress Grid Control also provides an asynchronous server mode, also known as Instant Feedback mode. It is the same as the Server Mode except it reloads data in a background thread to make sure your application's UI doesn't freeze.

Invoke the Data Source Wizard once again. This time, choose Asynchronous Server-Side Data Processing to enable the Instant Feedback mode. Then select the desired table, key expression and default sorting again.

Launch the app to see the changes. Notice that the grid doesn't freeze while scrolling, grouping and sorting data. The loading indicator is displayed in the top-left corner while the data is retrieved in a background thread.

Expanded Supported Data Access Technologies

Note that the Entity Framework is not the only technology that supports these data binding modes. In the Visual Studio Toolbox, you can see the data source components that are used in Server Mode and Instant Feedback Mode for various data access technologies - Entity Framework, LINQ to SQL, Parallel LINQ to Objects or WCF Data Services.

You can add these components from the toolbox and bind the data manually instead of using the Wizard. Refer to product documentation to learn more (Large Data Sources: Server and Instant Feedback Modes).

Expanded See Also

How would you rate this topic?​​​​​​​