Hello, one of my columns in the XamDataGrid is time. I have the following to verify that a proper time has been entered:
<Style x:Key="TimeFieldStyle" TargetType="{x:Type igWPF:XamMaskedEditor}"> <Setter Property="Mask" Value="##:##" /> <Setter Property="ValueConstraint"> <Setter.Value> <igWPF:ValueConstraint RegexPattern="^(?:[01][0-9]|2[0-3]):[0-5][0-9]$" /> </Setter.Value> </Setter> </Style>
if a proper time has not been entered a message box pops up and says "Value does not match required pattern." Is there any way of changing that text to something custom?
Thanks
Hello KrisVice,
Thank you for your post.
To modify the "Value does not match required pattern" text that shows when a user enters a value that does not coincide with the given Regex pattern, I would recommend modifying that particular resource string on the XamMaskedEditor. How to do this can be seen in our online documentation article about modifying resource strings for WPF Specific components. Here is a link to that article: http://help.infragistics.com/Help/Doc/WPF/2014.2/CLR4.0/html/GeneralConcepts_Customizing_Resource_Strings_for_WPF_Only_control.html.
The particular resource string you are looking for is named "LMSG_ValueConstraint_RegexPattern". So if you use the following code, you will be able to set your own custom resource string to your XamMaskedEditor:
Infragistics.Windows.Editors.Resources.Customizer.SetCustomizedString("LMSG_ValueConstraint_RegexPattern", "MyCustomString");
I have attached a sample application to demonstrate the above.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Just checking in, did you have any other questions or concerns on this matter?