skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class MaskDateTimeProvider

A provider used to validate values of type System.DateTime

Inheritance
System.Object
BaseMaskDateProvider
MaskDateTimeProvider
ArabicMaskDateTimeProvider
FreeFormDateTimeProvider
Inherited Members
BaseMaskDateProvider.oldSelectedIndex
BaseMaskDateProvider.keyCounter
BaseMaskDateProvider.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.Owner
BaseMaskDateProvider.SelectedItemIndex
BaseMaskDateProvider.AutoSelectNextPart
BaseMaskDateProvider.EnableKeyNavigation
BaseMaskDateProvider.MaskFromFormat
BaseMaskDateProvider.DateTimeFormatInfo
BaseMaskDateProvider.TextBoxItem
BaseMaskDateProvider.Culture
BaseMaskDateProvider.Mask
BaseMaskDateProvider.IncludePrompt
BaseMaskDateProvider.PromptChar
BaseMaskDateProvider.List
BaseMaskDateProvider.SelectedItemChanged
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll

Syntax

public class MaskDateTimeProvider : BaseMaskDateProvider, IMaskProvider

Constructors

MaskDateTimeProvider(String, CultureInfo, RadMaskedEditBoxElement)

Initializes a new instance of the MaskDateTimeProvider class.

Declaration
public MaskDateTimeProvider(string mask, CultureInfo culture, RadMaskedEditBoxElement owner)
Parameters
System.String mask

The mask.

System.Globalization.CultureInfo culture

The culture.

RadMaskedEditBoxElement owner

The owner.

Properties

AutoCompleteYear

Indicates whether to auto-complete years on user input.

Declaration
public bool AutoCompleteYear { get; set; }
Property Value
System.Boolean

HoursStep

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

Declaration
public int HoursStep { get; set; }
Property Value
System.Int32

MaxDate

Gets or sets the max date.

Declaration
public DateTime MaxDate { get; set; }
Property Value
System.DateTime

MaxSupportedDateTime

Gets the max supported date.

Declaration
protected virtual DateTime MaxSupportedDateTime { get; }
Property Value
System.DateTime

MillisecondsStep

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

Declaration
public int MillisecondsStep { get; set; }
Property Value
System.Int32

MinDate

Gets or sets the min date.

Declaration
public DateTime MinDate { get; set; }
Property Value
System.DateTime

MinSupportedDateTime

Gets the min supported date.

Declaration
protected virtual DateTime MinSupportedDateTime { get; }
Property Value
System.DateTime

MinutesStep

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

Declaration
public int MinutesStep { get; set; }
Property Value
System.Int32

SecondsStep

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

Declaration
public int SecondsStep { get; set; }
Property Value
System.Int32

Value

Gets or sets the value.

Declaration
public override object Value { get; set; }
Property Value
System.Object

Overrides
BaseMaskDateProvider.Value

YearResetValue

Determines the year value when is has been reset.

Declaration
public int YearResetValue { get; set; }
Property Value
System.Int32

Methods

Clone()

Clones this instance.

Declaration
public override IMaskProvider Clone()
Returns
IMaskProvider

The cloned instance.

Overrides
BaseMaskDateProvider.Clone()

Down(MaskPart, DateTime, DateTime)

Decreases the value of the given MaskPart.

Declaration
public virtual void Down(MaskPart part, DateTime minDate, DateTime maxDate)
Parameters
MaskPart part

The MaskPart.

System.DateTime minDate

The min date.

System.DateTime maxDate

The max date.

FillCollection()

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

Declaration
protected override void FillCollection()
Overrides
BaseMaskDateProvider.FillCollection()

FillCollection(String)

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

Declaration
protected static List<MaskPart> FillCollection(string mask)
Parameters
System.String mask

The mask.

Returns
System.Collections.Generic.List<MaskPart>

A list with MaskPart objects.

FillCollectionWithValues()

Fills the List with values based on the Value.

Declaration
protected override void FillCollectionWithValues()
Overrides
BaseMaskDateProvider.FillCollectionWithValues()

GetSpecificFormat(String, DateTimeFormatInfo)

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

Declaration
public static string GetSpecificFormat(string mask, DateTimeFormatInfo info)
Parameters
System.String mask

The mask.

System.Globalization.DateTimeFormatInfo info

The culture specific format info.

Returns
System.String

The format string.

HandleAmPmKeyPress(KeyPressEventArgs)

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

Declaration
protected virtual void HandleAmPmKeyPress(KeyPressEventArgs e)
Parameters
System.Windows.Forms.KeyPressEventArgs e

The key event arguments.

HandleKeyPress(MaskPart, KeyPressEventArgs)

Handles a key press operation over a specific MaskPart.

Declaration
protected virtual bool HandleKeyPress(MaskPart part, KeyPressEventArgs e)
Parameters
MaskPart part

The selected MaskPart.

System.Windows.Forms.KeyPressEventArgs e

The key event arguments.

Returns
System.Boolean

Not used.

HandleKeyPressDay(MaskPart, KeyPressEventArgs)

Handles a key press operation over a day MaskPart.

Declaration
protected virtual void HandleKeyPressDay(MaskPart part, KeyPressEventArgs e)
Parameters
MaskPart part

The day MaskPart.

System.Windows.Forms.KeyPressEventArgs e

The key event arguments.

HandleKeyPressHour(MaskPart, KeyPressEventArgs)

Handles a key press operation over an hour MaskPart.

Declaration
protected virtual void HandleKeyPressHour(MaskPart part, KeyPressEventArgs e)
Parameters
MaskPart part

The hour MaskPart.

System.Windows.Forms.KeyPressEventArgs e

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
protected virtual void HandleKeyPressWithCharacters(MaskPart part, KeyPressEventArgs e, string[] names)
Parameters
MaskPart part

The MaskPart.

System.Windows.Forms.KeyPressEventArgs e

The key event arguments.

System.String[] names

The names collection to match.

HandleMonthKeyPress(KeyPressEventArgs, MaskPart)

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

Declaration
protected virtual void HandleMonthKeyPress(KeyPressEventArgs e, MaskPart part)
Parameters
System.Windows.Forms.KeyPressEventArgs e

The key event arguments.

MaskPart part

The month MaskPart.

HandleSpinDown(DateTime, DateTime)

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

Declaration
public virtual void HandleSpinDown(DateTime minDate, DateTime maxDate)
Parameters
System.DateTime minDate

The min date.

System.DateTime maxDate

The max date.

HandleSpinUp(DateTime, DateTime)

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

Declaration
public virtual void HandleSpinUp(DateTime minDate, DateTime maxDate)
Parameters
System.DateTime minDate

The min date.

System.DateTime maxDate

The max date.

IsAmPmMode()

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

Declaration
protected virtual bool IsAmPmMode()
Returns
System.Boolean

Whether the AM/MP mode is enabled.

KeyDown(Object, KeyEventArgs)

Occurs when a key is pressed.

Declaration
public override void KeyDown(object sender, KeyEventArgs e)
Parameters
System.Object sender

The sender.

System.Windows.Forms.KeyEventArgs e

Key event arguments.

Overrides
BaseMaskDateProvider.KeyDown(Object, KeyEventArgs)

KeyPress(Object, KeyPressEventArgs)

Occurs when a key is pressed.

Declaration
public override void KeyPress(object sender, KeyPressEventArgs e)
Parameters
System.Object sender

The sender.

System.Windows.Forms.KeyPressEventArgs e

Key event arguments.

Overrides
BaseMaskDateProvider.KeyPress(Object, KeyPressEventArgs)

ResetCurrentPartValue(Object, KeyEventArgs)

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

Declaration
public override void ResetCurrentPartValue(object sender, KeyEventArgs e)
Parameters
System.Object sender

The sender.

System.Windows.Forms.KeyEventArgs e

Key event arguments.

Overrides
BaseMaskDateProvider.ResetCurrentPartValue(Object, KeyEventArgs)

ResetDay(MaskPart)

Resets the day.

Declaration
protected virtual void ResetDay(MaskPart part)
Parameters
MaskPart part

The day MaskPart

ResetMonth(MaskPart)

Resets the month.

Declaration
protected virtual void ResetMonth(MaskPart part)
Parameters
MaskPart part

The month MaskPart

ResetOnDelPartValue(MaskPart, Int32)

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

Declaration
protected virtual bool ResetOnDelPartValue(MaskPart part, int keyChar)
Parameters
MaskPart part

The MaskPart

System.Int32 keyChar

The key char.

Returns
System.Boolean

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

ResetToMinDate()

Resets the value to the MinDate.

Declaration
public virtual void ResetToMinDate()

ResetYear(MaskPart)

Resets the year.

Declaration
protected virtual void ResetYear(MaskPart part)
Parameters
MaskPart part

The year MaskPart

SelectCurrentItemFromCurrentCaret()

Selects the current MaskPart based on the caret position.

Declaration
public override bool SelectCurrentItemFromCurrentCaret()
Returns
System.Boolean

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
public override void SelectCurrentItemWithSelectedItem()
Overrides
BaseMaskDateProvider.SelectCurrentItemWithSelectedItem()

SetDayMaxValue()

Sets the maximal day for the chosen year and month.

Declaration
protected virtual MaskPart SetDayMaxValue()
Returns
MaskPart

The day MaskPart.

ToString(Boolean, Boolean)

Gets the string interpretation of the value based on the Mask

Declaration
public override string ToString(bool includePrompt, bool includeLiterals)
Parameters
System.Boolean includePrompt

Not used.

System.Boolean includeLiterals

not used.

Returns
System.String

The string interpretation of the value based on the mask.

Overrides
BaseMaskDateProvider.ToString(Boolean, Boolean)

Up(MaskPart, DateTime, DateTime)

Increases the value of the given MaskPart.

Declaration
public virtual void Up(MaskPart part, DateTime minDate, DateTime maxDate)
Parameters
MaskPart part

The MaskPart.

System.DateTime minDate

The min date.

System.DateTime maxDate

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
public override bool Validate(string stringValue)
Parameters
System.String stringValue

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

Returns
System.Boolean

A value indicating whether the string value is valid.

Overrides
BaseMaskDateProvider.Validate(String)

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.