Using MasekdInput for the format: 2w 3d 4h 6m

2 posts, 0 answers
  1. Divya
    Divya avatar
    6 posts
    Member since:
    Apr 2014

    Posted 29 Aug 2014 Link to this post

    I require a control that would accept input in the form : 2 w 3 d 5 h 6 m. User should be able to input the values before d, w, h and m ( which represents weeks, days, hours, minutes). Is it possible to use MaskedInput to achieve the same. w,d,h and m should not be editable. How can I implement that?

  2. Petar Mladenov
    Petar Mladenov avatar
    2882 posts

    Posted 01 Sep 2014 Link to this post

    Hello Divya,

    I prepared a sample project for you and I hope it can serve as a base for your requirements. Basically I bound the Text of the RadMaskedTextInput to string property (TextValue) from the ViewModel. When the TextValue changes I update the Weeks, Hours, MInutes with parsing functions. If you need also two-way binding, you will need to bind the Value property of the MaskedTextInput to some other string property from the ViewModel. This property can be basically a product of concatenation ( this.Weeks +"w"+ this.Hours + "h +...).

    Let us know if this helps you move forward.

    Petar Mladenov
    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. DevCraft R3 2016 release webinar banner
Back to Top