New to Telerik UI for WinFormsStart a free 30-day trial

DateOnly Masks

Updated over 1 year ago

The tables below describe the mask characters that can be used when the MaskType is DateOnly. Note that the format characters are case sensitive.

Standard DateOnly Format codes

Format CharacterAssociated Property/ Description
dShortDatePattern
DLongDatePattern
m, MMonthDayPattern
r, RRFC1123Pattern
y, YYearMonthPattern

 Custom DateOnly Format codes

Where standard DateOnly codes are too restrictive, create your own custom formats using the format patterns listed below.

Format PatternDescription
ddThe day of the month. Single-digit days will have a leading zero.
dddThe abbreviated name of the day of the week, as defined in AbbreviatedDayNames.
MThe month, from 1 through 12.
MMThe numeric month. Single-digit months will have a leading zero.
MMMThe abbreviated name of the month, as defined in AbbreviatedMonthNames.
MMMMThe full name of the month, as defined in MonthNames.
yThe year without the century. If the year without the century is less than 10, the year is displayed with no leading zero.
yyThe year without the century. If the year without the century is less than 10, the year is displayed with a leading zero.
yyyyThe year in four digits, including the century.
ggThe period or era. This pattern is ignored if the date to be formatted does not have an associated period or era string.

Accessing the MaskDateOnlyProvider

When the mask type is set to DateOnly you can access the MaskDateOnlyProvider by casting to that appropriate type.

C#

this.radMaskedEditBox1.MaskType = MaskType.DateOnly;
MaskDateOnlyProvider provider = this.radMaskedEditBox1.MaskedEditBoxElement.Provider as MaskDateOnlyProvider;

See Also