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
  [Collapse]Business Model Design
    Business Model Design Basics
    Built-in Business Classes for Most Popular Scenarios
   [Expand]Business Model Design with Entity Framework
   [Expand]Business Model Design with XPO
    Non-Persistent Objects
    PropertyChanged Event in Business Classes
   [Collapse]Data Types Supported by built-in Editors
     Key Properties
    [Expand]String Properties
    [Expand]Numeric Properties
    [Expand]Date and Time Properties
    [Expand]Boolean Properties
    [Expand]BLOB Image Properties
    [Expand]Collection Properties
    [Expand]Reference (Foreign Key, Complex Type) Properties
    [Expand]File Attachment Properties
    [Collapse]Type Properties
      Type Properties in XPO
      Type Properties in Entity Framework
      Type Properties in DC
    [Expand]Enumeration Properties
    [Expand]Criteria Properties
    [Expand]Color Properties
     Geolocation Properties
     Miscellaneous Property Types
    Mapping Complex Types to the Database
   [Expand]Types Info Subsystem
    Connect an XAF Application to a Database Provider
    Data Annotations in Data Model
    Create and Update the Application's Database
  [Expand]Application Model
  [Expand]UI Construction
  [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

Type Properties

In XAF, properties of the System.Type type can be displayed in a combo box editor that lists the available object types in WinForms and ASP.NET applications or in a pop-up dialog in Mobile applications.

WinForms

ASP.NET

Mobile

Expanded Examples

Expanded WinForms Property Editors for System.Type Properties

Each WinForms Property Editor has a control that displays a corresponding property in a Detail View, and a repository item that displays a property in a List Editor that supports in-place editing. Both the control and repository item are shown below.

  • TypePropertyEditor

    Control: ImageComboBoxEdit editor from the XtraEditors Library.

    Repository Item: RepositoryItemImageComboBox item from the XtraEditors Library.

    Description:

    Used for Type properties by default.

    When declaring a Type property that is displayed using the TypePropertyEditor, apply the System.ComponentModel.TypeConverter attribute to it. In the attribute, pass the type of the converter that returns a collection of values representing data types in the Property Editor. For instance, pass a built-in LocalizedClassInfoTypeConverter, which returns Caption property values for the corresponding BOModel | <Class> nodes.

    If you do not use the TypeConverter attribute for a type property, a string representation of found types is loaded to the editor's Items collection.

    Use Alt + Down Arrow to expand the TypePropertyEditor's drop-down window.

  • VisibleInReportsTypePropertyEditor

    Control: ImageComboBoxEdit editor from the XtraEditors Library.

    Repository Item: RepositoryItemImageComboBox item from the XtraEditors Library.

    Description:

    Inherited from the TypePropertyEditor. Used by the Pivot Chart Module and Reports Module. It lists the types of business classes that have the VisibleInReports property of the Application Model's IModelClass node set to true.

Expanded ASP.NET Property Editors for System.Type Properties

Each ASP.NET Property Editor has controls that display a property in a Detail View's View and Edit mode (see DetailView.ViewEditMode). These controls are listed below.

  • ASPxTypePropertyEditor

    View mode control: System.Web.UI.WebControls.Label.

    Edit mode control: ASPxComboBox editor from the ASPxEditors Library.

    Description:

    Used for Type properties by default.

    When declaring a Type property that is displayed using the TypePropertyEditor, apply the System.ComponentModel.TypeConverter attribute to it. In the attribute, pass the type of the converter that returns a collection of values representing data types in the Property Editor. For instance, pass a built-in LocalizedClassInfoTypeConverter. It returns values of the Caption property of the corresponding BOModel | <Class> nodes.

    If you do not use the TypeConverter attribute for a type property, a string representation of found types is loaded to the editor's Items collection.

    To expand the editor's drop-down window, use Alt + Down Arrow.

  • ASPxVisibleInReportsTypePropertyEditor

    View mode control: System.Web.UI.WebControls.Label.

    Edit mode control: ASPxComboBox editor from the ASPxEditors Library.

    Description:

    Inherited from ASPxTypePropertyEditor. Used by the Pivot Chart Module and Reports Module. It lists the types of business classes that have the VisibleInReports property of the Application Model's IModelClass node set to true.

Expanded Mobile Property Editor for System.Type Properties

Each Mobile Property Editor has widgets that display a property in a Detail View's View and Edit mode (see DetailView.ViewEditMode). These widgets are listed below.

MobileTypePropertyEditor

View mode control: Label that displays text using the div HTML element.

Edit mode control: Lookup that uses the dxLookup widget.

Description:

Used for Type properties by default.

When declaring a Type property that is displayed using the MobileTypePropertyEditor, apply the System.ComponentModel.TypeConverter attribute to it. In the attribute, pass the type of the converter that returns a collection of values representing data types in the Property Editor. For instance, pass a built-in LocalizedClassInfoTypeConverter. It returns values of the Caption property of the corresponding BOModel | <Class> nodes.

If you do not use the TypeConverter attribute for a type property, a string representation of found types is loaded to the editor's Items collection.

Expanded Customize the Types List

Type Property Editors use the LocalizedClassInfoTypeConverter type converter to create the list of values displayed in the editor's combo box. By default, this converter returns persistent types only. To add all registered non-persistent types to this collection, inherit LocalizedClassInfoTypeConverter, modify the AllowAddNonPersistentObjects field value and pass the custom converter to the TypeConverter attribute type.

Override the AddCustomItems method in your custom converter to add specific types to the collection.

Override the GetSourceCollection method to create the entire collection manually.

Tip

More customization approaches are provided in the How to hide or filter out certain types from the drop-down editor for the System.Type properties knowledge base article.

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