Hi, I have a mask in which in using '&' to specify an optional character E.g. "&nnn.nn"
But I actually know that the only allowed character is an x and it's optional. Is there anyway to specify this in a mask?
I've tried the following masks:
"xnnn.n" - always shows the x
"{char:1:x}nnn.n" - isn't optional
Ideally I would want to do:
"{char:0-1:x}nnn.n"
Thanks, Mark.
Hello Mark,
It seems like that you are not able to achieve this functionality by setting the mask.
Hi Stefan, ideally i'd like the mask to handle this. We're binding the mask to the editor and changing it so the suggested solution won't work in this case.
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Hello,
Thank you for your post. I have been looking into it and I can suggest you use the following Mask:
?nnn.n
Also you should handle the XamEditor’s PreviewKeyDown event and use the following code in its handler:
if (e.Key != Key.X && (sender as XamMaskedEditor).SelectionStart == 0) { e.Handled = true; }
This way the editor will have the functionality you want. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.