This is a migrated thread and some comments may be shown as answers.

Best way to auto-insert date delimiter slashes

3 Answers 717 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 01 Mar 2011, 02:21 PM
I'm looking at how to auto-insert slashes as the user enters data into the text box part of the DateTimePicker control, but can't see an easy way to do this.
 
Too many properties are read only and if I try and set the value of the control in an event like ParseDateTimeValue the rest of the input then gets set to a valid date.

eg imagine the user wants to enter a date of 10/12/2010  as soon as they've entered "10" I want the input text box to display "10/" and have the cursor positioned ready for the month NOT have it switch in today's month and year with the cursor positioned at the end, which is what happens even if I don't go anwhere near the args.Result parameter that ParseDateTimeValue gives me to play with.

In many ways a MaskedTextBox offers something similar to what I want except our end-users don't want to use cursor keys to move between the slash delimiters.

Is there an easy way to implement what is required?

3 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 02 Mar 2011, 05:38 PM
Hello Ian,

Currently the control doesn't support the required functionality. A better choice would be using the RadMaskedTextBox.

Greetings,
Kaloyan
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Mike
Top achievements
Rank 1
answered on 02 Jun 2011, 04:47 PM
Hi,

I need to do the same thing with this control, did you manage to resolve the issue?

Thanks

Mike
0
Miroslav Nedyalkov
Telerik team
answered on 08 Jun 2011, 07:30 AM
Hi Mike,

 This behavior is by design - we wanted to provide a free text input DateTimePicker control that allows the user to input arbitrary text instead of masked input.
 I would suggest you the same thing that Kaloyan suggested - to use the RadMaskedTextBox control instead. If you need to show the button with the calendar and clock you may use the RadDropDownButton control, the RadCalendar control and the RadClock control with the RadMaskedTextBox (the same we did in the RadDateTimePicker, but with another TextBox).

Hope this helps.

Regards,
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
Tags
DateTimePicker
Asked by
Ian
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Mike
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Share this question
or