Is there a way to create a custom mask with my own valid characters?
I need to allow spaces AND be required, so a-z, A-Z, ' ', or 0-9
"A" is closest, Alphanumeric character placeholder. For example: a-z, A-Z, or 0-9. Character entry is required.
but does not allow for spaces
Regards
Eric
Hello Eric,
There are different approaches to solve this task. Maybe you could try one of these two options below:
Option 1: You could try to use Regular Expressions (RegEx). Using suitable event, you could validate the entered characters.
Option 2: You could try to implement IEditorDataFilter
Please take a look on attached video file and both samples with these two approaches and if you have any questions, feel free to write me
Sample 1
Sample 2
Thanks for the examples but they are not for masks, they only validate on leave.
Is there any interface to override for the mask that I can implement my own and extend "A"?
Also can't seem to find a e.Handeled in
IDUltraMaskedEdit_InvalidChar(object sender, Infragistics.Win.UltraWinMaskedEdit.InvalidCharEventArgs e)
Is there another event I can subscribe to?
Could you please give us a sample about desired mask. Did you try to set properties
- EditAs = UseSpecificMask
-Input Mask = aaa aa aaa aa aa
By this way you will be able to enter letters and digits with empty space. More details about the masks you could find at: http://help.infragistics.com/Help/Doc/WinForms/2012.2/CLR4.0/HTML/WinGrid_Formatting_Cells_Containing_Specific_Number_of_Characters.html
About your question for suitable event. At that moment we have not InvalidChar event, but maybe you could handle one of these events below:
- ultraMaskedEdit1_TextChanged
- ultraMaskedEdit1_ValueChanged
- ultraMaskedEdit1_Validating
Let me know if you have any further questions