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]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
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Collapse]Concepts
  [Expand]Application Solution Components
   Client-Side Mobile Application
  [Expand]Business Model Design
  [Expand]Application Model
  [Collapse]UI Construction
    UI Element Overview
    Windows and Frames
   [Expand]Templates
    Action Containers
   [Expand]Views
   [Collapse]View Items
     Implement Custom View Items
     Implement Custom Property Editors
     View Items Layout Generation
     View Items Layout Customization
    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
  [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
  Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

View Items

Dashboard Views and Detail Views consist of View Items. By default, a Detail View includes items that display a persistent object's properties. At the same time, the eXpressApp Framework allows flexible adaptation of Views to your individual needs. You can customize View Items used in a default UI, add custom items and change item layout. This topic explains how to do this with the help of the Application Model, and defines available View Item types. For information on how to implement your own View Item, refer to the Implement Custom View Items and Implement Custom Property Editors topics.

View Items are abstract UI entities represented by ViewItem class descendants. To create actual controls, each item type overrides the protected CreateControlCore method, called when an item needs to be displayed in a UI. Since different controls are used in Windows Forms and ASP.NET Web applications, there are View Items individually implemented for Windows and Web UI. These items are supplied in DevExpress.ExpressApp.Win and DevExpress.ExpressApp.Web assemblies respectively.

The eXpressApp Framework supplies the following basic View Item types:

Item Type Description
ActionContainerViewItem Displays an Action Container specified by the IModelActionContainerViewItem.ActionContainer property of the Application Model's corresponding ActionContainerViewItem node. Used to display Actions on a Detail View layout.
ControlViewItem Displays a control specified by the IModelControlDetailItem.ControlTypeName property of the Application Model's corresponding ControlDetailItem node (see How to: Show a Custom Data-Bound Control in an XAF View (WinForms)). So, you can specify a control (Windows Forms or ASP.NET) that will be displayed in a UI. This View Item type is declared in the DevExpress.ExpressApp.dll assembly and is UI independent.
WebCustomUserControlViewItem Displays a a data-bound ASP.NET User Control control specified by the IModelCustomUserControlViewItemWeb.CustomControlPath property of the Application Model's corresponding CustomUserControlViewItemWeb node (see How to: Show a Custom Data-Bound Control in an XAF View (ASP.NET)).
DashboardViewItem Displays a View in a nested Frame. Used to display several Views side-by-side on a Dashboard View.
PropertyEditor Displays an editor control bound to a property. There are multiple property editor types in XAF. They are intended for different data types, and therefore use different controls. For example:
More Property Editors intended for various property types are listed in the Data Types Supported by built-in Editors section.
StaticImage Displays an image.
StaticText Displays a label.

By default, View Item controls are initialized only once they are visible to end-users, to speed up creation of complex Views (see XafApplication.DelayedViewItemsInitialization). Use the ViewItem.ControlCreated event to access a control.

The Application Model loads both custom View Items that are implemented in your application, and all items from referenced modules. Those View Item types that have particular properties are used for automatic UI construction (refer to the Implement Custom View Items and Implement Custom Property Editors topics to learn about these properties). Via the following nodes of the Application Model, you can investigate what View Items will be used in your application, and what customizations you can apply:

  • ViewItems node

    This node has child nodes that correspond to the basic View Item types. These View Items are used to construct Detail Views. Examples of these base types are Static Text, Static Image, Property Editor, etc. Each base type is actually represented in the UI by a particular descendant class. This descendant is specified via the DefaultItemType property. If there are multiple descendants available, you can select the desired class via the property's drop-down list.

    Since different data types require different Property Editors, the PropertyEditors node supplies child nodes corresponding to data types. These child nodes specify the default Property Editor for each data type, using the EditorType property.

    The following picture illustrates the ViewItems node:

  • Views | DashboardView or DetailView | Items node

    This node lists the current Detail View's items. By default, it contains only Property Editor nodes. Their PropertyEditorType property specifies the Property Editor type used in a UI. Of course, you can change the default property value by selecting another property editor type from the dropdown list.

    You can also add other View Items to a Detail View. To do this, use the Model Editor's context menu. If you add a Static Text, Static Image or Control item, you can use the ItemType property to specify the actual class used to represent this item in a UI.

  • Views | DashboardView or DetaiView | Layout node.

    This node specifies the layout of the current View's items. Items can be grouped or located separately. You can change the default layout, by using the context menu and specifying property values in the Model Editor. In addition, the Model Editor allows you to view the resulting items layout. When the Layout node is selected, the property list to the right is displayed with a design surface that emulates the current View. To drag the View Items, right-click on the empty space, and select Customize Layout. The Customization form will be invoked. Close this form, to go back to the view mode of the emulated View.

    For details, refer to the View Items Layout Customization topic.

Note

You can find built-in View Items from the eXpressApp Framework libraries in the Model Editor, invoked for a Windows Forms or ASP.NET Web application project, since the DevExpress.ExpressApp.Win assembly is referenced in Windows Forms application projects, and the DevExpress.ExpressApp.Web assembly in the Web application projects.

Expanded See Also

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