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
Hello Niko,
What version of Infragistics are you using? I tested this with 17.2.20172.1000 and I can see the BlueViolet bottom border along with the Triggers as you mentioned.
I have attached my sample for demonstration. If this sample is different from your scenario, please feel free to modify it or send your own sample.
1122.XamMaskedInput_UsingMask.zip
Also, I will be out of the office until Monday, Dec. 18. If you require immediate assistance with this please email DSManager@infragistics.com.
Sincerely,Michael H.Software DeveloperInfragistics, Inc.www.infragistics.com
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>
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