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
  [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
    [Collapse]Date and Time Properties
      Date and Time Properties in XPO
      Date and Time Properties in Entity Framework
      Date and Time Properties in Domain Components
    [Expand]Boolean Properties
    [Expand]BLOB Image Properties
    [Expand]Collection Properties
    [Expand]Reference (Foreign Key, Complex Type) Properties
    [Expand]File Attachment Properties
    [Expand]Type Properties
    [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
 [Expand]Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
[Expand]End-User Documentation

Date and Time Properties

XAF provides property editors for DateTime and TimeSpan types. Nullable DateTime properties are also supported.

Windows Forms

ASP.NET

Note

To see Date and Time Property Editors in action, refer to the Property Editors | DateTime Properties section in the Feature Center demo installed with XAF. By default, the Feature Center demo is installed in %PUBLIC%\Documents\DevExpress Demos 17.1\Components\eXpressApp Framework\FeatureCenter. The ASP.NET version of this demo is available online at http://demos.devexpress.com/XAF/FeatureCenter/.

Expanded Examples

Expanded Windows Forms Property Editors for Date and Time 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. The table below shows both the control and repository item.

Property Editor Type and Description Control Repository Item

DatePropertyEditor

Used for DateTime type properties by default.
Stores and displays values using the DateTime mask type. To set a mask, use the Property Editor's EditMask property in code, or the Views | <DetailView> | Items | <PropertyEditor> node's IModelCommonMemberViewItem.EditMask property in the Model Editor.
To invoke a dropdown calendar, click the editor's arrow or double-click the editor. In the invoked calendar, click the current date at the top, select a date or click Clear to empty the editor's value.
You can type a date without using the dropdown calendar.
To set the current date without using the dropdown calendar, press the Space bar.
To clear the editor's value without using the dropdown calendar, press CTRL+0 or CTRL+DELETE.
To expand the DateTimeEdit drop-down window, use Alt + Down Arrow.
DateTimeEdit - a descendant of the DateEdit editor from the XtraEditors Library RepositoryItemDateTimeEdit - a descendant of the RepositoryItemDateEdit repository item from the XtraEditors Library

TimeSpanPropertyEditor

Used for TimeSpan type properties by default.
This Property Editor has the EditMaskType property, which is set to RegEx by default. This means that you can specify the EditMask (in code or in the Model Editor) using extended regular expressions. In addition, you can set the EditMaskType property to the required mask type and specify the mask. To do this, you can access the required TimeSpanPropertyEditor instance using a View Controller (see Access Editor Settings).
TimeSpanEdit - a descendant of the TextEdit editor from the XtraEditors Library RepositoryItemTimeSpanEdit - a descendant of the RepositoryItemTextEdit repository item from the XtraEditors Library

Expanded ASP.NET Property Editors for Date and Time Properties

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

Property Editor Type and Description

Control Used in View Mode

Control Used in Edit Mode

ASPxDateTimePropertyEditor

Used for DateTime type properties by default.
Stores and displays values using the specified mask. To set a mask, use the Property Editor's EditMask property in code, or the Views | <DetailView> | Items | <PropertyEditor> node's IModelCommonMemberViewItem.EditMask property in the Model Editor.
To invoke a dropdown calendar, click the editor's arrow or double-click the editor. In the invoked calendar, click the current date at the top, select a date, or click Clear to empty the editor's value.
To invoke a dropdown calendar, click the editor's arrow. In the invoked calendar, click Today at the bottom, select a date, or click Clear to empty the editor's value.
You can type a date without using the dropdown calendar.
To expand the DateTimeEdit's drop-down window, press Alt + Down Arrow.
System.Web.UI.WebControls.Label ASPxDateEdit editor from the ASPxEditors Library

ASPxTimeSpanPropertyEditor

Used for timespan properties by default.
Inherited from the ASPxStringPropertyEditor class.
System.Web.UI.WebControls.Label ASPxTextBox editor from the ASPxEditors Library

Expanded See Also

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