RadMaskedDateTimeInput Edit Mode Displays Current Time Only

3 posts, 1 answers
  1. Jacob
    Jacob avatar
    6 posts
    Member since:
    Mar 2013

    Posted 11 Jun 2013 Link to this post

    Hi Telerik,

    I am using a RadMaskedDateTimeInput control in my application. It is being used in a RadGridView's CellEditTemplate edit mode and the value is bound to a TimeSpan object with the property [ Mask = HH:mm ]

    When I enter edit mode in run time it seems to be displaying/bound to Today.Now and/or DateTime.Now (It is only showing the current Hour/Minutes). Is this a known bug or should I be using another InputMask control to accomplish this. I only want to see the correct time in this format 00:00 [HH:mm]

    Thanks!
  2. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 13 Jun 2013 Link to this post

    Hello Jacob,

     RadMaskedDateTimeInput uses internally DateTime? (nullable DateTime) property to store its Value.
    In other words, the Value property of this control is from type DateTime? and it cannot be directly bound to TimeSpan property. At least you need a converter. Since your binding does not succeed (due to mismatch of types), the fallback value which is DateTime.Now is being used.
    So our advice is to bind the Value of the DateTimeInput to property of type DateTime?. Let us know if this fits well in your scenario.

    Regards,
    Petar Mladenov
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Jacob
    Jacob avatar
    6 posts
    Member since:
    Mar 2013

    Posted 13 Jun 2013 Link to this post

    This is exactly it. Thank you! :)
Back to Top