Mask for 25 hours

4 posts, 0 answers
  1. Maurizio
    Maurizio avatar
    43 posts
    Member since:
    Jan 2012

    Posted 10 Sep 2014 Link to this post

    We want to use RadMaskedDateTimeInput to let the user enter TimeSpans fo more than 24 hours.
    For example 25 hours should be displayed and entered as

    25:00:00  or   01:01:00:00 (one day and one hour)

    using a "HH:mm:ss" or "dd:HH:mm:ss" mask does not work! 
  2. Milena
    Admin
    Milena avatar
    203 posts

    Posted 15 Sep 2014 Link to this post

    Hi Peter,

    RadDateTimeInput uses a DateTime type as value and not TimeSpan. So, if you need to use TimeSpan as a Value of the MaskedInputControl you should use:
    - RadMaskedTextInpud with custom mask token which takes only digits - you can see how to write this in our help topic - Mask Tokens. In your case your valid characters would be only digits and the mask would be "$$:$$:$$" to have ":" symbols between the numbers;
    - use a ViewModel and custom validation rule to restrict the user input per your requirement. More about validations you can find here

    Please take a look at this topics and write us back if you need any further assistance. 

    Regards,
    Milena
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Maurizio
    Maurizio avatar
    43 posts
    Member since:
    Jan 2012

    Posted 18 Sep 2014 Link to this post

    Hi Milena,

    I got it working with a RadMaskedTextInput and Mask = "##:##:##:##". 

    But it's been a pain in the a... I had to write my own converter for String-TimeSpan conversion. Would be cool to have a Telerik control for TimeSpans as well.

    Thanks for you answer.
  5. Milena
    Admin
    Milena avatar
    203 posts

    Posted 19 Sep 2014 Link to this post

    Hi Peter,

    Thank you for the feedback.

    Indeed, currently the required functionality is not supported in the RadMaskedInput suite. However, you can log a feature request in our Feedback portal. So, we can then further research on it and decide if it will be approved and implemented as a built-in feature. 
     
    Regards,
    Milena
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top