Hello,
I need a text input that allows only a specific set of characters:
I tried to use following mask Mask="{char:50:0-9a-zA-Z,}" but it doesn't do the trick.
Additional functionality: It would be great if the characters a-z would be set automatically into Uppercase.
Please advice how this can be achieved. I guess that the - minus sign needs to be escaped in some way.
Thanks
Niko
Hi Niko,
Thank you for posting in our forums!
Part of the issue is that you cannot start a mask with '{' with the {char} mask because WPF considers '{' to be special syntax. Instead, you would want to use:
Mask="{}{char:50:0-9a-zA-Z,-}"
No escaping is needed for the '-'. Also, the '>' character in a mask will force all following entries into uppercase. So, you would end up using the following mask to meet your requirements:
Mask=">{char:50:0-9A-Z,-}"
If you have any further questions or concerns with this, please let me know.
Sincerely,Michael H.Software DeveloperInfragistics, Inc.www.infragistics.com/support
Hello Michael,
thanks for the quick response. It works very well.
I am also styling the controls and have noticed that the XamMaskedEditor keeps a border even when I define it differently.
I see that the style triggers kick in, but the basic settings e.g. BorderThickness 0 0 0 1 is ignored.
Do you have an advice how to solve this?
<Style TargetType="{x:Type ig:XamMaskedInput}" x:Key="Testme"> <Setter Property="PromptChar" Value=" " /> <Setter Property="Margin" Value="0,0,0,10" /> <Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="Height" Value="20" /> <Setter Property="BorderThickness" Value="0 0 0 1" /> <Setter Property="BorderBrush" Value="BlueViolet" /> <Style.Triggers> <Trigger Property="IsKeyboardFocusWithin" Value="true"> <Setter Property="BorderThickness" Value="0 5 0 1" /> <Setter Property="BorderBrush" Value="OrangeRed" /> <Setter Property="Background" Value="Gold" /> </Trigger> <Trigger Property="IsMouseOver" Value="true"> <Setter Property="BorderThickness" Value="0 2 0 1" /> <Setter Property="BorderBrush" Value="Yellow" /> </Trigger> </Style.Triggers> </Style>