Log In
[Expand]General Information
[Expand]WinForms Controls
[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]Office File API
[Expand]Report and Dashboard Server
[Collapse]eXpressApp Framework
 [Expand]Getting Started
  [Expand]Application Solution Components
   Client-Side Mobile Application
  [Expand]Business Model Design
  [Expand]Application Model
  [Collapse]UI Construction
    UI Element Overview
    Windows and Frames
    Action Containers
     Ways to Show a View
     List View Column Generation
     List View Columns Customization
     List View Bands Layout
     List View Edit Modes
    [Collapse]List View Data Access Modes Overview
      Client Mode
      Server and InstantFeedback Modes
      DataView Mode
     Display Properties of a Referenced Object in the Master Object's View
   [Expand]View Items
    List Editors
    Add and Override Images
    Text Notifications
    Ways to Show a Confirmation Dialog
    ASP.NET Web Application Appearance
    Application Personalization
    Using a Custom Control that is not Integrated by Default
    XAF Mobile Wrappers for DevExtreme Widgets
  [Expand]Extend Functionality
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging, Testing and Error Handling
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Task-Based Help
  Frequently Asked Questions (FAQ)
 [Expand]API Reference
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
This documentation page describes implementations made in our v17.2 release cycle. To learn about functionality shipping with v18.1, navigate to our updated help file experience at docs.devexpress.com. Learn More

List View Data Access Modes Overview

This topic describes the process of choosing and applying the different techniques on how you can provide data access in a List View using the Model Editor. Note that choosing the correct technique may be critical to achieving your XAF application's best performance.

Expanded Choose an Appropriate Data Access Mode

The default mode in WinForms and ASP.NET applications is Client Mode, which is appropriate in most cases. The DataView, Server and InstantFeedback modes are intended to improve List View performance, but in different areas. In Mobile applications, only the Server mode is supported.

  • If the database request count is critical, then you should choose DataView mode. In this mode, all data records are fetched by a single request, and then grouping, sorting, and filtering are executed on the client side without additional requests. The DataView mode is appropriate for cases when the current persistent type contains many references to other persistent types, which also include numerous references. In the DataView mode, only data required by visible columns is loaded, while the Client and Server modes trigger multiple requests to load the entire date hierarchy. It is important that you do not use original objects in the DataView mode; this mode creates and uses the XafDataViewRecord objects accordingly.

  • If List View startup time is critical, then you should choose Server or Instant Feedback mode. In these modes, only a few visible objects are fetched by the first request when a List View is opened. However, scrolling, grouping, sorting and filtering lead to additional database requests - requiring data to be loaded on demand. It is important that you do not use original objects in the InstantFeedback mode; this mode creates and uses the XafInstantFeedbackRecord objects accordingly.

  • If the performance is acceptable, simply use the Client mode. Do not enable Server, Instant Feedback or DataView mode unless you observe a lack of performance. Note that the Server and Instant Feedback modes make no sense if the collection is small and all objects are loaded on the first request, or you have a code that iterates all objects in the collection (such a code leads to loading the entire collection).

Expanded Applying Data Access Modes

In the Model Editor, the IModelListView.DataAccessMode property of the Views | <ListView> node specifies how the displayed object collection is accessed. Available values - Client, Server, InstantFeedback and DataView are contained in the CollectionSourceDataAccessMode enumeration.

Modes that are not compatible with the current List Editor (specified using the IModelListView.EditorType property) are hidden from the combo box. If you use a custom List Editor, you can specify supported modes using the DataAccessModeHelper.RegisterEditorSupportedModes static method. You can call this method from any code that is executed at design time prior to loading the Model Editor (e.g., from the module's constructor). Pass the List Editor type and the list of it's supported modes to this method. By default, all modes are available for a custom List Editor.

You can change the data access mode globally for all List Views (except for the autogenerated nested List Views) using the IModelOptions.DataAccessMode property of the Options node. All manually created List Views, including nested List Views, have the same IModelListView.DataAccessMode property value as the global IModelOptions.DataAccessMode option.

Note, when you create a Collection Source (see ListView.CollectionSource) in code, you can use the CollectionSource.CollectionSource constructor with the dataAccessMode parameter.

To display a non-persistent property in the Server, InstantFeedback or Data View mode, apply the PersistentAliasAttribute or CalculatedAttribute attribute to this property declaration. Note that some operations, such as filtering, sorting and grouping, do not work with non-persistent properties in the InstantFeedback and Server modes, and to prevent these operations from execution for non-persistent properties, set the ColumnsListEditor.PreventServerSideOperationsForNonPersistentMembers to true.

Expanded See Also

Is this topic helpful?​​​​​​​