Hello
I'm trying to use a RadMaskedEditBox control with MaskType.Regex. And I want to be able to use more than 1 pattern for correct validating. I have those two patterns:
^[0-9]{6} [A-Z]{4} [0-9]{7}$
^[0-9]{5}$
I change those two patterns to one pattern like this:
^[0-9]{6} [A-Z]{4} [0-9]{7}$|^[0-9]{5}$
If I set the MaskType and Mask properties in designer, the control gets validated correct. But if I set those two properties programmatically (e.g. on form load), it is not validated correct. I can't type in five digits when setting the properties programmatically. Both patterns are exactly the same (also in debugger).
So I'm very confused now why it works in designer but not programmatically. I use this two lines of code in form load event:
radMaskedEditBox1.MaskType = MaskType.Regex;
radMaskedEditBox1.Mask =
"^[0-9]{6} [A-Z]{4} [0-9]{7}$|^[0-9]{5}$"
;
The first pattern (before pipe character) can be validated, but not the second one. The second one can only be validated if I set the properties in designer.
Do you have any suggestions? Do I have to remember something?
Regards,
Danilo