6 Answers, 1 is accepted
The new MaskedInput suite of controls provides 4 different controls - MaskedDateTimeInput, MaskedTextInput, MaskedNumericInput and MaskedCurrencyInput. Each control is designed to allow a specific type of user input. We decided to provide this suite of controls due to the many known limitations in the RadMaskedTextBox control. For example, the MaskedInput controls support a null value.
Also, they further enhance the validation support by providing validation through Regular Expressions, ValidatesOnExceptions and binding validations. Furthermore, the MaskedInput controls allow you to define custom mask tokens. You can read more about the MaskedInput controls in our online documentation.
However, there are still cases in which the RadMaskedTextBox control might be a better choice. If you can describe the scenario you have, we might be able to tell you which control exactly is most suitable for you.
Kiril Stanoev
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
The fields i have are:
Name - here i just need a watermark
Description - watermark
Units - numeric mask
Price - price mask - showing british pound sign
So not very complex.
Thanks
Thank you for getting back to us. In the described scenario the MaskedInput suite of controls is a better choice. This demo sample can help you get started. More information about the controls you can read in their online documentation.
All the best,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Here is my case:
I am building Phone CustomControl. It has two parts related to the topic.
One is the TextBox that Visible when the (bound) Country is not US and displays free text
The other is MaskedTextBox/Input that is Visible when the Country is US and allow formatted entry like (###)###-####
They (TextBox and Masked...) bound to same property (String Phone).
The issue with MaskedTextInput (does not appear with MaskedTextBox) that
when I enter The phone "1112223333" into TextBox (not US) and then
switch country to US the MaskedTextInput overwrites Phone property with an empty Mask ( "( ___)___-____" ).
The MaskedTextBox does not do that it takes (bound) unformatted string and displays it as "(111)222-3333"
Questions are:
1. Is there a propery on MaskedTextInput that will fix that?
2. Why should use one or the other? (MaskedTextBox vs MaskedTextInput)
Let us first make a quick clarification - we are now in a process of resolving the MaskedInput's main issues (that usually stop our clients upgrading from MaskedTextBox to MaskedInput) and our goal is to obsolete the RadMaskedTextBox next year.
Now straight to your issue. We tried different scenarios (changing the culture) with RadMaskedTextInput, TextBox and RadMaskedTextBox bound to the same property. It seems that the code works as expected. Please take a look of the attached project and see if it works for you. In case it is not suitable please change the project in way corresponding to your scenario.
All the best,
Pavel R. Pavlov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
The issue I had was related to the fact (I think) that I bound MaskedTextInput.Text to the phone property. Binding to the MaskedTextInput.Value worked correctly (as in your example). Thank you.