Add mask template to DateTimePicker

2 posts, 0 answers
  1. Randy
    Randy avatar
    30 posts
    Member since:
    Jun 2008

    Posted 27 Jul 2010 Link to this post

    Are there any plans to add the ability to specify a mask template for the data entry of the DateTimePicker?  For example, I might specify the Short DisplayFormat and the InputMode of DatePicker to allow only a date to be entered/selected.  But as it exists today, I can type in any set of characters into the input portion of the control.  The control will let you know that the input is invalid but it would be nice to not allow the characters to be entered in the first place.

    I know that there is a workaround to combine the MaskedTextbox control with the DateTimePicker to achieve this behavior but that is more overhead that could be avoided if the masking logic was included with the DateTimePicker control.

  2. Miroslav Nedyalkov
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 28 Jul 2010 Link to this post

    Hello Randy,

     The DateTimePicker control is designed to have free text box where you can type arbitrary strings and the control tries to parse your input. We are not currently planning to add masked behavior to it as this will limit typing strings like "Monday" or "tomorrow". Though we will consider your suggestion.

    What I could suggest you is to use a MaskedTextBox, a DropDownButton and a Calendar in the DropDownButton - this is similar to what we do in the DateTimePicker control.

    All the best,
    Miroslav Nedyalkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top