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

4 posts, 0 answers
  1. Oliver Abraham
    Oliver Abraham avatar
    13 posts
    Member since:
    Mar 2010

    Posted 29 Sep 2011 Link to this post

    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
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 03 Oct 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Oliver Abraham
    Oliver Abraham avatar
    13 posts
    Member since:
    Mar 2010

    Posted 08 Dec 2011 Link to this post

    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
  5. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 12 Dec 2011 Link to this post

    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 >>

Back to Top