Class
MaskDateTimeProvider

A provider used to validate values of type DateTime

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

cs-api-definition
public class MaskDateTimeProvider : BaseMaskDateProvider, IMaskProvider

Inheritance: objectBaseMaskDateProviderMaskDateTimeProvider

Derived Classes: ArabicMaskDateTimeProviderFreeFormDateTimeProvider

Implements: IMaskProvider

Inherited Members BaseMaskDateProvider.oldSelectedIndexBaseMaskDateProvider.keyCounterBaseMaskDateProvider.Click()BaseMaskDateProvider.Delete()BaseMaskDateProvider.GetGroupLengthByMask(string)BaseMaskDateProvider.AdjustItemsOffset()BaseMaskDateProvider.SelectNextEditableItemFromCurrentCaret()BaseMaskDateProvider.SelectPrevItemFromCurrentCaret()BaseMaskDateProvider.SelectNextItemFromCurrentCaret()BaseMaskDateProvider.SelectPrevItem()BaseMaskDateProvider.SelectNextItem()BaseMaskDateProvider.SelectLastItem()BaseMaskDateProvider.SelectFirstItem()BaseMaskDateProvider.SelectFirstEditableItem()BaseMaskDateProvider.SelectLastEditableItem()BaseMaskDateProvider.SelectPrevEditableItem()BaseMaskDateProvider.SelectNextEditableItem()BaseMaskDateProvider.RestoreSelectedItem()BaseMaskDateProvider.OwnerBaseMaskDateProvider.SelectedItemIndexBaseMaskDateProvider.AutoSelectNextPartBaseMaskDateProvider.EnableKeyNavigationBaseMaskDateProvider.MaskFromFormatBaseMaskDateProvider.DateTimeFormatInfoBaseMaskDateProvider.TextBoxItemBaseMaskDateProvider.CultureBaseMaskDateProvider.MaskBaseMaskDateProvider.ListBaseMaskDateProvider.SelectedItemChanged

Constructors

MaskDateTimeProvider(string, CultureInfo, RadMaskedEditBoxElement)

Initializes a new instance of the MaskDateTimeProvider class.

Declaration

cs-api-definition
public MaskDateTimeProvider(string mask, CultureInfo culture, RadMaskedEditBoxElement owner)

Parameters

mask

string

The mask.

culture

CultureInfo

The culture.

owner

RadMaskedEditBoxElement

The owner.

Properties

AutoCompleteYear

Indicates whether to auto-complete years on user input.

Declaration

cs-api-definition
public bool AutoCompleteYear { get; set; }

Property Value

bool

HoursStep

Gets or sets the hours step used when modifying the value.

Declaration

cs-api-definition
public int HoursStep { get; set; }

Property Value

int

MaxDate

Gets or sets the max date.

Declaration

cs-api-definition
public DateTime MaxDate { get; set; }

Property Value

DateTime

MaxSupportedDateTime

Gets the max supported date.

Declaration

cs-api-definition
protected virtual DateTime MaxSupportedDateTime { get; }

Property Value

DateTime

MillisecondsStep

Gets or sets the milliseconds step used when modifying the value.

Declaration

cs-api-definition
public int MillisecondsStep { get; set; }

Property Value

int

MinDate

Gets or sets the min date.

Declaration

cs-api-definition
public DateTime MinDate { get; set; }

Property Value

DateTime

MinSupportedDateTime

Gets the min supported date.

Declaration

cs-api-definition
protected virtual DateTime MinSupportedDateTime { get; }

Property Value

DateTime

MinutesStep

Gets or sets the minutes step used when modifying the value.

Declaration

cs-api-definition
public int MinutesStep { get; set; }

Property Value

int

SecondsStep

Gets or sets the seconds step used when modifying the value.

Declaration

cs-api-definition
public int SecondsStep { get; set; }

Property Value

int

Value

Gets or sets the value.

Declaration

cs-api-definition
public override object Value { get; set; }

Property Value

object

Overrides BaseMaskDateProvider.Value

YearResetValue

Determines the year value when is has been reset.

Declaration

cs-api-definition
public int YearResetValue { get; set; }

Property Value

int

Methods

Clone()

Clones this instance.

Declaration

cs-api-definition
public override IMaskProvider Clone()

Returns

IMaskProvider

The cloned instance.

Overrides BaseMaskDateProvider.Clone()

Down(MaskPart, DateTime, DateTime)

Decreases the value of the given MaskPart.

Declaration

cs-api-definition
public virtual void Down(MaskPart part, DateTime minDate, DateTime maxDate)

Parameters

part

MaskPart

The MaskPart.

minDate

DateTime

The min date.

maxDate

DateTime

The max date.

FillCollection()

Fills the List with MaskPart objects used to validate the value and user input.

Declaration

cs-api-definition
protected override void FillCollection()

Overrides BaseMaskDateProvider.FillCollection()

FillCollection(string)

Returns a list used to validate the value and user input.

Declaration

cs-api-definition
protected static List<MaskPart> FillCollection(string mask)

Parameters

mask

string

The mask.

Returns

List<MaskPart>

A list with MaskPart objects.

FillCollectionWithValues()

Fills the List with values based on the Value.

Declaration

cs-api-definition
protected override void FillCollectionWithValues()

Overrides BaseMaskDateProvider.FillCollectionWithValues()

GetSpecificFormat(string, DateTimeFormatInfo)

Gets the format string from the mask using the culture specific format info.

Declaration

cs-api-definition
public static string GetSpecificFormat(string mask, DateTimeFormatInfo info)

Parameters

mask

string

The mask.

info

DateTimeFormatInfo

The culture specific format info.

Returns

string

The format string.

HandleAmPmKeyPress(KeyPressEventArgs)

Handles a key press operation when a am/pm part is selected.

Declaration

cs-api-definition
protected virtual void HandleAmPmKeyPress(KeyPressEventArgs e)

Parameters

e

KeyPressEventArgs

The key event arguments.

HandleKeyPress(MaskPart, KeyPressEventArgs)

Handles a key press operation over a specific MaskPart.

Declaration

cs-api-definition
protected virtual bool HandleKeyPress(MaskPart part, KeyPressEventArgs e)

Parameters

part

MaskPart

The selected MaskPart.

e

KeyPressEventArgs

The key event arguments.

Returns

bool

Not used.

HandleKeyPressDay(MaskPart, KeyPressEventArgs)

Handles a key press operation over a day MaskPart.

Declaration

cs-api-definition
protected virtual void HandleKeyPressDay(MaskPart part, KeyPressEventArgs e)

Parameters

part

MaskPart

The day MaskPart.

e

KeyPressEventArgs

The key event arguments.

HandleKeyPressHour(MaskPart, KeyPressEventArgs)

Handles a key press operation over an hour MaskPart.

Declaration

cs-api-definition
protected virtual void HandleKeyPressHour(MaskPart part, KeyPressEventArgs e)

Parameters

part

MaskPart

The hour MaskPart.

e

KeyPressEventArgs

The key event arguments.

HandleKeyPressWithCharacters(MaskPart, KeyPressEventArgs, string[])

Handles a key press operation with a character. Tries to match the value by the given names collection.

Declaration

cs-api-definition
protected virtual void HandleKeyPressWithCharacters(MaskPart part, KeyPressEventArgs e, string[] names)

Parameters

part

MaskPart

The MaskPart.

e

KeyPressEventArgs

The key event arguments.

names

string[]

The names collection to match.

HandleMonthKeyPress(KeyPressEventArgs, MaskPart)

Handles a key press operation when a month part is selected.

Declaration

cs-api-definition
protected virtual void HandleMonthKeyPress(KeyPressEventArgs e, MaskPart part)

Parameters

e

KeyPressEventArgs

The key event arguments.

part

MaskPart

The month MaskPart.

HandleSpinDown(DateTime, DateTime)

Handles a spin down operation, usually when the keyboard down arrow key was pressed.

Declaration

cs-api-definition
public virtual void HandleSpinDown(DateTime minDate, DateTime maxDate)

Parameters

minDate

DateTime

The min date.

maxDate

DateTime

The max date.

HandleSpinUp(DateTime, DateTime)

Handles a spin up operation, usually when the keyboard up arrow key was pressed.

Declaration

cs-api-definition
public virtual void HandleSpinUp(DateTime minDate, DateTime maxDate)

Parameters

minDate

DateTime

The min date.

maxDate

DateTime

The max date.

IsAmPmMode()

Get a value indicating whether the AM/PM mode is enabled.

Declaration

cs-api-definition
protected virtual bool IsAmPmMode()

Returns

bool

Whether the AM/MP mode is enabled.

KeyDown(object, KeyEventArgs)

Occurs when a key is pressed.

Declaration

cs-api-definition
public override void KeyDown(object sender, KeyEventArgs e)

Parameters

sender

object

The sender.

e

KeyEventArgs

Key event arguments.

Overrides BaseMaskDateProvider.KeyDown(object, KeyEventArgs)

KeyPress(object, KeyPressEventArgs)

Occurs when a key is pressed.

Declaration

cs-api-definition
public override void KeyPress(object sender, KeyPressEventArgs e)

Parameters

sender

object

The sender.

e

KeyPressEventArgs

Key event arguments.

Overrides BaseMaskDateProvider.KeyPress(object, KeyPressEventArgs)

ResetCurrentPartValue(object, KeyEventArgs)

Resets the value of the currently selected part of the mask.

Declaration

cs-api-definition
public override void ResetCurrentPartValue(object sender, KeyEventArgs e)

Parameters

sender

object

The sender.

e

KeyEventArgs

Key event arguments.

Overrides BaseMaskDateProvider.ResetCurrentPartValue(object, KeyEventArgs)

ResetDay(MaskPart)

Resets the day.

Declaration

cs-api-definition
protected virtual void ResetDay(MaskPart part)

Parameters

part

MaskPart

The day MaskPart

ResetMonth(MaskPart)

Resets the month.

Declaration

cs-api-definition
protected virtual void ResetMonth(MaskPart part)

Parameters

part

MaskPart

The month MaskPart

ResetOnDelPartValue(MaskPart, int)

Resets the given part value if the key char is delete or backspace.

Declaration

cs-api-definition
protected virtual bool ResetOnDelPartValue(MaskPart part, int keyChar)

Parameters

part

MaskPart

The MaskPart

keyChar

int

The key char.

Returns

bool

A value indicating whether the value of the part was reset.

ResetToMinDate()

Resets the value to the MinDate.

Declaration

cs-api-definition
public virtual void ResetToMinDate()

ResetYear(MaskPart)

Resets the year.

Declaration

cs-api-definition
protected virtual void ResetYear(MaskPart part)

Parameters

part

MaskPart

The year MaskPart

SelectCurrentItemFromCurrentCaret()

Selects the current MaskPart based on the caret position.

Declaration

cs-api-definition
public override bool SelectCurrentItemFromCurrentCaret()

Returns

bool

A value indicating whether a part was selected.

Overrides BaseMaskDateProvider.SelectCurrentItemFromCurrentCaret()

SelectCurrentItemWithSelectedItem()

Selects the text in the TextBoxItem which corresponds to the SelectedItemIndex in the List.

Declaration

cs-api-definition
public override void SelectCurrentItemWithSelectedItem()

Overrides BaseMaskDateProvider.SelectCurrentItemWithSelectedItem()

SetDayMaxValue()

Sets the maximal day for the chosen year and month.

Declaration

cs-api-definition
protected virtual MaskPart SetDayMaxValue()

Returns

MaskPart

The day MaskPart.

ToString(bool, bool)

Gets the string interpretation of the value based on the Mask

Declaration

cs-api-definition
public override string ToString(bool includePrompt, bool includeLiterals)

Parameters

includePrompt

bool

Not used.

includeLiterals

bool

not used.

Returns

string

The string interpretation of the value based on the mask.

Overrides BaseMaskDateProvider.ToString(bool, bool)

Up(MaskPart, DateTime, DateTime)

Increases the value of the given MaskPart.

Declaration

cs-api-definition
public virtual void Up(MaskPart part, DateTime minDate, DateTime maxDate)

Parameters

part

MaskPart

The MaskPart.

minDate

DateTime

The min date.

maxDate

DateTime

The max date.

Validate(string)

Validates the given string value and sets it as Value if the value is valid. If the value cannot be parsed to the underlying data type of the Value, it is reset to its default value.

Declaration

cs-api-definition
public override bool Validate(string stringValue)

Parameters

stringValue

string

The string value that is about to be set to the Value.

Returns

bool

A value indicating whether the string value is valid.

Overrides BaseMaskDateProvider.Validate(string)