Skip to main content
A newer version of this page is available. .

DateEdit Class

The editor to edit date/time values using a dropdown calendar.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v18.1.dll

Declaration

[DefaultBindingPropertyEx("DateTime")]
[ToolboxBitmap(typeof(ToolboxIconsRootNS), "DateEdit")]
[ToolboxTabName("DX.18.1: Common Controls")]
public class DateEdit :
    PopupBaseEdit,
    IDateRangeCollectionOwner

Remarks

The DateEdit control allows date/time values to be entered using a dropdown calendar and edit box.

DateEdit-class

The DateEdit.Properties property (a RepositoryItemDateEdit class instance) contains the DateEdit control’s various settings.

Use the RepositoryItemDateEdit.CalendarView property to choose a calendar style:

Calendar Style Description
CalendarView.Vista

The Vista-style calendar:

 

CalendarView.TouchUI

The touch-aware date-editing UI:

   

For a DateEdit control, the control’s mask (see the RepositoryItemTextEdit.Mask inherited property) specifies which date-time columns are displayed in the dropdown calendar.

To display time columns, enable the RepositoryItemDateEdit.CalendarTimeEditing option.

CalendarView.Classic

The classic calendar:

   

CalendarView.ClassicNew

An Outlook 2016-inspired calendar style.

   

Main Settings and Events

Masked Input

By default, DateEdit functions in the DateTime masked mode, which allows you to enter date/time values using one of the standard or custom date/time patterns. By default, the edit mask (RepositoryItemDateEdit.EditMask) is set to “d” (short date pattern).

You are not limited to using only the default DateTime masked mode. You can enable other masked modes or disable the mask functionality, using the MaskProperties.MaskType (DateEdit.Properties.Mask.MaskType) property. For instance, enable the DateTimeAdvancingCaret mask mode to automatically skip date separators while entering date/time values.

Note

The date/time masks only support the following calendars: Gregorian, Korean, Taiwan, and Thai Buddhist.

Refer to the Mask Type: Date-time topic for more information.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DateEdit class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also