Default DateEdit

This example demonstrates the Bootstrap Date Edit control with default settings. The Bootstrap Date Edit control is a date editor control that combines the functionality of a single-line text editor, button editor, and drop-down calendar.

<dx:BootstrapDateEdit runat="server" Date="1.1.2017">
</dx:BootstrapDateEdit>

Time Section

The Date Edit control allows you to edit date-time values using a time section of drop-down window or directly within an edit box. The time section settings can be accessed through the TimeSectionProperties property:

The EditFormat property allows you to specify whether the edit box should display a date, time, or both.

<dx:BootstrapDateEdit runat="server" Date="1.1.2017 8:00" EditFormat="DateTime">
    <TimeSectionProperties Visible="true" />
</dx:BootstrapDateEdit>

Multi-Month View

This example illustrates the multi-month view feature. The drop-down calendar of the Date Edit control below simultaneously displays multiple months, organizing them into several rows and columns.

<dx:BootstrapDateEdit runat="server">
    <CalendarProperties Columns="2"></CalendarProperties>
</dx:BootstrapDateEdit>

Disabled Dates

In this example, some of the dates displayed by the Date Edit control's drop-down calendar are disabled, so they appear grayed out and cannot be selected. The control provides two approaches to disabling dates.

<dx:BootstrapDateEdit ID="DateEditDisabledDates" runat="server" OnCalendarCustomDisabledDate="DateEdit_CustomDisabledDate">
    <ClientSideEvents CalendarCustomDisabledDate="onCustomDisabledDate" />
</dx:BootstrapDateEdit>

Null Text

This example illustrates how the NullText property can be used to display prompt text (watermark) in the editor's edit box. Specified text is displayed when the value of the editor is null and the editor is not focused. The prompt text disappears when the editor receives focus. To show the null text even in the focused editor set the NullTextDisplayMode property to UnfocusedAndFocused.

<dx:BootstrapDateEdit runat="server" NullText="Enter Your Birth Date">
</dx:BootstrapDateEdit>

Mask

In this example, the Date Edit control takes advantage of the masked input feature to only accept values in a specific date format. To enable masked input within a date editor, the UseMaskBehavior property should be set to true.

The mask is specified using the EditFormatString property when the EditFormat property is set to Custom.

<dx:BootstrapDateEdit runat="server" Date="1.1.2017" EditFormat="Custom" EditFormatString="MMMM dd, yyyy" UseMaskBehavior="true">
</dx:BootstrapDateEdit>

Display Format

The DisplayFormatString property specifies the pattern used to format the value of an editor for display purposes when the editor is not focused. Display values can be formatted using the standard formatting mechanism described in MSDN. For more information about composing format patterns, see the following MSDN topics: Numeric Format Strings and Date and Time Format Strings.

<dx:BootstrapDateEdit runat="server" Date="1.1.2017" DisplayFormatString="D">
</dx:BootstrapDateEdit>

Caption and HelpText

In this example, the Date Edit control displays a caption on the top and auxiliary help text at the bottom of the editor.

<dx:BootstrapDateEdit runat="server" Caption="Birthday" HelpText="Enter your birthday">
    <ValidationSettings RequiredField-IsRequired="true"></ValidationSettings>
</dx:BootstrapDateEdit>
Screen Size
Color Themes
Demo QR Code