I use the RadMaskedTextInput with a numeric mask like this '##-######' ( the behavior expected is '123-456789' ) , in an earlier version this works fine, but now with the newest version it's allows alphanumeric characters and appears a tooltip with the message 'Invalid Input'.
There is a way to prevent alphanumeric characters with the numeric mask implemented ??
Notes: We can't use RadMaskedNumericInput with the mentioned mask ( '##-######' ) because the '-' minus character, so we use the RadMaskedTextInput .
Sorry my english...
13 Answers, 1 is accepted
Could you please send us your XAML and your ViewModels (if any) ? This will help us better investigate the issue ? What are the exact settings that used to work before and are broken in Q3 2013 SP?
Regards,Petar Mladenov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Just Is a basic implementation of the control, the problem is the difference between the current and previous version..
The code is the same....I only change the DLL version...
public
string
FederalEmployerIdentificationNumber {
get
;
set
; }
<
telerik:RadMaskedTextInput
x:Name
=
"maskFeinNumber"
Grid.Column
=
"1"
TabIndex
=
"15"
Width
=
"167"
Height
=
"24"
Value
=
"{Binding Path=CurrentClient.FederalEmployerIdentificationNumber, Mode=TwoWay}"
Mask
=
"##-#######"
IsClearButtonVisible
=
"False"
InputBehavior
=
"Replace"
/>
Now alphanumeric characters are allowed if you use a numeric mask, even in the official demo. How I prevent this..? I can suscribe to the KeyDown event to try handle this scenario, but does not work how is expected. There is a way to make it work like the previous version?
Alphanumeric usually refers to mixture of alphabetic and numeric characters. Do you mean that you need to disallow users to type alphabetic characters only ? If yes, you can try the approach from this help article.
It is also important for us to know what is your previous version of RadControls ?
Petar Mladenov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Yes is exactly what I need, but even implementing the custom token has the same behavior than the token #.
I submitted a ticket support (725682 ) with two samples for two differents releases. The first correspond to the Q3 2012 SP1 (MaskedInputSamplePrevious) and the second correspond to the Q2 2013 SP1 (MaskedInputSampleLast).
Note that the code is the same for both ( It's include an NUMERIC mask ) in the previous version you can not type an alphabetic character and in the last version it is allowed. Even with custom token, the result is the same behavior unexpected. I want only enter Numeric characters!! like in the oldest version.
How I mentioned , I was trying with custom tokens like you suggest. But still allowed alphabetic characters.
using
System.Linq;
using
Telerik.Windows.Controls.MaskedInput.Tokens;
namespace
SLCast.Common.Helpers
{
public
class
NumericMaskToken : ITokenValidationRule
{
#region ITokenValidationRule Members
public
bool
IsRequired
{
get
{
return
false
; }
}
public
bool
IsValid(
char
ch)
{
return
ValidChars.Contains(ch);
}
public
char
Token
{
get
{
return
'$'
; }
}
public
TokenTypes Type
{
get
{
return
TokenTypes.AlphaNumeric; }
}
private
string
myValidChars =
"0123456789"
;
public
string
ValidChars
{
get
{
return
myValidChars; }
}
#endregion
}
}
This appears to be abug in our MaskedTextInput introduced in Q2 2013 SP. We logged it in PITS and we will try to fix it for some of the next internal builds. Please excuse us for the inconvenience caused.
Regards,Petar Mladenov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
In my case I am on version : 2012 Q2 and I am using the Alpha Numeric mask as Mask=">A4" on the RadMaskedTextInput.
I am expecting that it will allow me to enter a-z , A-Z, 0-9 and it does a good job at that but it also lets me enter all other characters.
Tried this on the demo site which is 2013 Q2 but exhibits similar issue.
Is there a different token I should be using? I would just like to disallow entering of characters other than alpha numeric ones.
I'll take any workaround, I am already extending the control.
Thanks!
We highly encourage you to avoid workarounds in this scenario. Actually this issue is already resolved and the fix is included in our latest internal builds as well as in the upcoming Q3 Official Release next month.
Regards,Petar Mladenov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
So for now I will need a workaround for 2012 Q2 if there is any.
Thanks!
You can try using the ValueChanging event and prevent value from updating if it contains non-alphanumeric symbols. In an MVVM scenario you can perform this validation in the setter of the ViewModels string property which is bound to the Value of the MaskedTextInput.
We hope this will help you proceed further.
Petar Mladenov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Any thoughts?
I think I have mislead you in my previous post in this thread. I've thought you mean this issue:
MaskedInput: Using alphabetic symbols in "####" masks is possible but it should not. Introduced in Q2 2013 SP.
This is the issue that is fixed in Q3.
As for entering symbols like "-", ".", "/", "\" we have always allowed entering such ones with Mask = A2, A3, A 20 etc. Even our help demonstrates such symbols with Mask=AAAAA. That is why we cannot change this behavior out of the box - this will be a breaking change.
To workaround this you can use the ValueChanging event of the MaskedInput controls.
Please again excuse me for the inconvenience caused.
Regards,
Petar Mladenov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
We used Custom Tokens following this help article and created a sample project for you.
The idea is that you can create mask token that accepts only certain range of symbols:
public
char
Token
{
get
{
return
'$'
; }
}
public
TokenTypes Type
{
get
{
return
TokenTypes.AlphaNumeric; }
}
private
string
myValidChars =
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
;
Regards,
Petar Mladenov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>