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

RadMaskedDateTimeInput: Possible to enter 0000-00-00 for "open end" ?

3 Answers 76 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Oliver Abraham
Top achievements
Rank 2
Oliver Abraham asked on 29 Sep 2011, 09:23 AM
We're using the date value 9999-12-31 as a kind of "open end" or "umlimited" flag in RadMaskedDateTimeInput.
Is it possible to set up the control so that the entry 0000-00-00 is possible ?

(Our customers know this value from an older product and it's much easier to enter. The RadMaskedDateTimeInput may convert this value internally to 9999-12-31)

Best regards
Oliver

3 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 03 Oct 2011, 12:13 PM
Hello Oliver,

 You can use the ParseDateTimeValue event of the RadDateTimePicker control to override the user's input. For more information about how to add logic in the parsing process, please refer to this article.

Hope this helps.

Greetings,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Oliver Abraham
Top achievements
Rank 2
answered on 08 Dec 2011, 12:18 PM
Hello Miroslav,
hmm, the Parse function you mentioned works, but RadDateTimePicker hat the disadvantage taht it is not formatted and you can't limit the entry to 10 characters (00.00.0000). It doesn't feel good using it.
I would prefer to use RadMaskedDateTimeInput.

Question: Is it possible to allow 00.00.0000 in RadMaskedDateTimeInput ? I tried using the ValueChanging event, and I always get events on every input, but entering 00.00.0000 I only get "System.ArgumentOutOfRangeException" in mscorlib.dll  in debug output. (Q3/2011 WPF)
Is it a bug ?

Best regards
Oliver Abraham
0
Alex Fidanov
Telerik team
answered on 12 Dec 2011, 04:57 PM
Hi Oliver Abraham,

The RadMaskedDateTimeInput control supports only valid date time objects or null as value. Therefore, it is not possible to have a date like :00.00.0000. However, you can have a null date. Is it possible to use a nullable date as the minimum/maximum value of your field? For example:

<telerik:RadMaskedDateTimeInput Value="{x:Null}" EmptyContent="00.00.0000"/>

The empty content will show up when your valid is null and the control is not currently being editted (when it loses focus).

Best wishes,
Alex Fidanov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
DateTimePicker
Asked by
Oliver Abraham
Top achievements
Rank 2
Answers by
Miroslav Nedyalkov
Telerik team
Oliver Abraham
Top achievements
Rank 2
Alex Fidanov
Telerik team
Share this question
or