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
    [Expand]List View Data Access Modes Overview
     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
 End-User Documentation

Views

To display objects in a UI, eXpressApp Framework uses Views. Views have access to a specified data store, and allow end-users to browse and edit data. Since data browsing and editing is the primary function of most business applications, Views have a central position in a UI. eXpressApp Framework uses three types of views: a Detail View, a List View and a Dashboard View. These types are abstract UI-independent elements. This topic discusses the Views' role in eXpressApp Framework applications, and methods to access and customize them.

Expanded Object View

An Object View is specified by the ObjectView class. Object View is a View that is directly bound to data - to a single data object, or an object collection. There are two sub-types of Object Views - DetailView and List View.

Expanded Detail View

A Detail View is specified by the DetailView class. It provides access to a single data object, which can be accessed via the DetailView.CurrentObject property. All the persistent properties and fields of the current object get bound to Property Editors. Property Editors are displayed in a UI via editors specific to target data types and the application type. In addition to Property Editors, a Detail View can have other elements such as static text, static images, etc. All these elements are stored in a Detail View's CompositeView.Items collection. You can add, insert and delete items from this collection via the CompositeView.AddItem, CompositeView.InsertItem and CompositeView.RemoveItem methods. You can also retrieve an array of View Items of a particular type using the GetItems<T> method.

When a Detail View needs to be displayed in a UI, its View.CreateControls method is called. This method creates controls for each View Item from the Items collection.

Expanded List View

A List View is defined by the ListView class. It provides access to an object collection. For this purpose, it uses an object derived from the CollectionSourceBase class. This object, in turn, provides methods to work with a collection of objects retrieved from a database. For instance, you can access a View's object collection via the CollectionSourceBase.Collection property.

List Views are visualized by means of List Editors (see ListEditor). When a List View needs to be displayed in a UI, its View.CreateControls method is called. This method creates the List Editor's control. By default, XtraGrid is created in Windows Forms applications, and ASPxGridView is created in ASP.NET Web applications. Both these controls are supplied by the DXperience Suite produced by DevExpress.

Note

List Views, intended to be used in Lookup Property Editors and popup windows, are called Lookup List Views. Typically, they contain fewer columns then ordinary List Views (see List View Column Generation). The Lookup List View should not be considered as a special type of List View - there is no actual difference between them. By default, the Application Model nodes defining List Views have identifiers with the "_ListView" suffix, and nodes defining Lookup List Views – the "_LookupListView" suffix. This is no more than a naming convention - you can use an ordinary List View as a Lookup and visa versa. To determine if the List View is a Lookup in a custom Controller, you should check whether the current Template implements the ILookupPopupFrameTemplate interface. An example is provided in the How to: Detect a Lookup List View in Code topic.

Expanded Dashboard View

A Dashboard View is defined by the DashboardView class. A Dashboard View is not bound to data directly, but it can be a container for other Views. Dashboard Views are used to display several Views side-by-side in a single Frame (on a single screen). Each View is represented by a DashboardViewItem. The View displayed by the item is specified via the IModelDashboardViewItem.View property of the Application Model's corresponding DashboardView node. In addition, Dashboard Views may include static text and images (see StaticText and StaticImage)

When a Dashboard View needs to be displayed in a UI, its View.CreateControls method is called. For each DashboardViewItem, the method creates a nested Frame displaying the View Item's View.

Note

In Mobile applications, a Dashboard View is not supported.

Expanded Customize Views

The eXpressApp Framework searches business classes in all referenced modules. For each class, it collects the information required to create a List View and a Detail View. This information is stored within the Application Model and is used when a View needs to be created. For instance, this information includes data fields to be displayed, their captions, order, visibility, etc.

Though eXpressApp Framework automatically generates a default UI for you, you may need to customize it. For example, you may need to change the layout of editors in a Detail View, or column visibility in a List View. This can be done using the following three methods.

  • Customize the Application Model
    The simplest way to customize Views that take part in a UI generation is to configure the Application Model's Views node. You can do this at both design time and runtime via the Model Editor. In particular, you can customize a Detail View's Property Editors layout (see Customize the View Items Layout), a List View's columns settings (see Change Field Layout and Visibility in a List View) and so on. You can also add a new View to this node via the Model Editor's context menu. To add a navigation menu entry for a newly created View, add a new child node to the Application Model's NavigationItems | Items node and specify its View property. If you want the newly created View to be displayed for a business class by default, specify the Application Model's BOModel | <Class> node's IModelClass.DefaultDetailView or IModelClass.DefaultListView property. You can also generate View nodes in code as illustrated in the How to: Create Additional ListView Nodes in Code using a Generator Updater topic.
  • Utilize The End-User Customization Capabilities of Editor Controls
    To display a View, eXpresApp Framework uses controls from the DXperience Suite. Most of these controls allow end-user customization. For example, end-users can use a grid's column header context menu to customize List Views in Windows Forms applications. In addition, Detail Views can be customized using the Customization Window provided by XtraLayoutControl. For information on these runtime customization techniques, refer to the End-User Capabilities and Default Runtime Customization topics.
  • Customize View Objects in Code

    You can customize a View via its properties. In particular, you can access the View Item collection via the CompositeView.Items property, and customize settings of particular View Items. For instance, you can make them read-only. In addition, you can access a View Item's control and customize it, e.g., make it invisible. For examples, refer to the Access Editor Settings and Access Grid Control Properties tutorials.

    Use of Controllers to implement a feature is a common practice in XAF applications. So, to customize Views in code you will most likely be using a Window or a View Controller. View Controllers provide the ViewController.View property, which allows you to access a View. In a Window Controller, use the Frame.View property of the Controller's WindowController.Window. If you implement a custom Controller descendant, use the View property of the Controller's Controller.Frame.

Expanded See Also

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