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

MaskedTextInput -- can't insert

1 Answer 31 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Trump
Top achievements
Rank 1
Trump asked on 24 Oct 2018, 11:53 PM

I want to use MaskedTextInput to replace textbox with StringFormat, it is pretty simple.

<telerik:RadMaskedTextInput Text="{Binding SSN, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" InputBehavior="Replace"  Mask="###-##-####" />

I use it to display the SSN in the certain format when I get it from the service. Also I want to update it as well.

At the beginning, it is empty. I tried to insert a random value. But I can only insert the first two number. Sometimes even I can't insert a letter. There is a red X on the right of the textbox, Not sure what is wrong.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Dinko
Telerik team
answered on 29 Oct 2018, 12:37 PM
Hi Trump,

Looking at the provided code snippet you have bound only the Text property, not the Value property. The Value property represents the user input without the formatting characters. The Text property will always retrieve the user's input formatted according to the Mask and the TextMode property. Also, the "#" means that the user restricted to enter only digit symbol. You can read more about the mask tokens in the Mask Tokens help article. If you want to allow typing letters and digits you can use "a" or "A" token. I have created a sample project to demonstrate this approach. Give it a try and let me know if it works for you.

Regards,
Dinko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Trump
Top achievements
Rank 1
Answers by
Dinko
Telerik team
Share this question
or