Hi,
Sorry if my question has been asked already in this forum.
I'm using a RadMaskedTextInput with a dynamic MASK set in code behind. My current mask is d4Sd3. Therefore, I am expecting 4 digits followed with a capital S and then another 3 digits.
It works well except that in my code behind I would like to get the full content of the input. If I type in 1234567 it displays 1234S567 which is perfect, but then in my code behind I only get 1234567 and the "S" is gone. I need this S to remain in this string. How can I achieve such thing ? This is just an example, it could be any sort of mask.
Cheers,
Chris
7 Answers, 1 is accepted
The Value in combination with the Placeholder and Mask symbols (such as "S" in the Mask "d4Sd3") is kept in the Text property of the RadMaskedTextInput. However, please keep in mind that this property is designed to work only to retrieve the Text, setting it will do nothing and will not update the Value property.
Text property can return different results depending on the value of the TextMode property.
Regards,
Petar Mladenov
Telerik
See What's Next in App Development. Register for TelerikNEXT.
In R3 2017 we released a ValueMode property of the RadMaskedTextInput allowing masked symbols, placeholders, escaped symbols to be included in the Value property. Could you please check if it works in your scenario, instead of using the Text property ?
RadMaskedTextInput Value Mode
Regards,
Petar Mladenov
Progress Telerik
Yes, I had taken a look at that property before posting. Unfortunately, our current version does not include it, our license is expired, and I'm not sure my boss will want to renew it just to fix this particular issue.
I found a workaround by putting the contents of the data template inside a user control, although I'm getting another problem when trying to restore the text box to its original value (we have a Cancel button that lets the user undo any editing). But that's another story.
Could you please confirm you have solved your scenario ? If no, you can add more code to better illustrate the issue. This way we could check if it is solved in latest version or if an easier workaround is applicable.
Regards,
Petar Mladenov
Progress Telerik
Yes, solved using the Text property, with the control inside a UserControl.
Once we renew our license, I will try with the ValueMode property.