Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Collapse]Concepts
  [Expand]Application Solution Components
  [Expand]Business Model Design
  [Expand]Application Model
  [Collapse]UI Construction
    UI Element Overview
    Windows and Frames
   [Expand]Templates
    Action Containers
   [Collapse]Views
     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
    ASP.NET Web Application Appearance
    Application Personalization
    Using a Custom Control that is not Integrated by Default
  [Expand]Extend Functionality
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]Localization
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging and Error Handling
  [Expand]Filtering
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Expand]Task-Based Help
 [Expand]Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
[Expand]End-User Documentation

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 a filtering, sorting and grouping, does 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

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