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

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

1 Answer 16 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Divya
Top achievements
Rank 1
Divya asked on 29 Aug 2014, 05:12 AM
Hi,
 
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?

Thanks,
Divya

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 01 Sep 2014, 11:05 AM
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.

Regards,
Petar Mladenov
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.
 
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Divya
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or