Hi,
I am using a XamNumericEditor with masking property. Everything working fine except when I clear the XamNumericEditor it goes red and give a
"Value '' could not be converted" tooltip message. can I get rid of this message or atleast change it to a custom message.
Here's my code
<igEditors:XamNumericEditor x:Name="ValueFrequency2" Width="170" Style="{StaticResource XamNumericEditorStyle}" Height="23" Text="{Binding Frequency, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,TargetNullValue=''}" Mask="{}{double:-4.5}" AlwaysValidate="True" InvalidValueBehavior="Default" PromptChar=" " > <igEditors:XamNumericEditor.ValueConstraint> <igEditors:ValueConstraint ValidateAsType="Double" MinInclusive="1" Nullable="False" MaxInclusive="9999" /> </igEditors:XamNumericEditor.ValueConstraint> </igEditors:XamNumericEditor>
I have binded it with a non-nullable double property.
Please help.
Thanks in advance
nk
Hello Nkaur,
Thank you for your post.
I have been investigating your issue and I could not manage to reproduce it with 14.2 and higher version of Infragistics controls. It seem that it was an issue that was fixed in higher versions. The behavior that you have described is not reproducible with latest version of Infragistics 14.2 controls an higher. The best approach that I can suggest is to upgrade your project to the latest version 14.2 or higher.
Please let me know if you require any further assistance on the matter.
Hi Zhivko Nikolov,
Thank you for your reply.
I now understand the converter use here.
For my tab issue I am attaching a video here please look at it. I am using Infragistics 11.2
For reproducing it you just have to clear the numeric textbox and click on tab2.
Thanks alot for your time and patience.
Regards
Nkaur
I have been looking into your requirements. If I understand you correctly you want to validate the editor`s value when it is null only with pop up message. In order to be able to get around the message “Value could not be converted” you can provide converter in the Binding for Value of XamNumericEditor. When you clear the XamNumericEditor it will return null and try to convert that. You can check in the converter whether the Value is null and return Binding.DoNothing or if it is something different you can try to convert it and return the converted value. In order to validate when the editor`s value is null you can set the Nullable property that I mentioned in my previous post to False.
About your third question, could you please provide me with more details about this behavior and the version of assemblies that you are using. I try to investigate this behavior but I could not manage to reproduce it. I tested with the latest Service Release of Infragistics controls 14.2 and 15.1. Also It will be great if you could provide some steps to reproduce it.
I modified the last sample application to show you how you can implement this approach in order to be able to achieve the functionality that you are looking for. Also I created short video to show you how the sample application works on my side. Please take a look at the sample application and video and let me know if I am missing something else from your scenario.
Looking forward to hearing from you.
I think you didn't understood my concern. I don't want to stop that null value pop-up. I want to get rid of that red highlighted error on my numeric editor that say "Value ''could not be converted " on null value or at-least change than error tooltip.
Secondly, I didn't understand how changing float converter works at your end. You haven't passed any converter Parameter, also it wont get into any of the switch case after your change. please help me to understand here.
3rd and most important when I change tab after putting invalid value in xamNumericEditor , error pops up 15-20 times. Does this happens to your end also. Please help me in this.
Thank you for your feedback.
I have been looking into your post and it seem that the behavior that you have described derives from your data and converter. As I mentioned in my previous post when you clear the XamNumericEditor it will return null and will try to save that. There is property named Nullable in your ValueConstraint that indicates if the user is allowed to delete all the contents of the editor. In order to be able to avoid the invalid value popup when deleting all contents of the editor you should set this property to True. You can take a look for more details about the functionality of Nullable property at the following link from our online documentation:
http://help.infragistics.com/doc/WPF/2015.1/CLR4.0/?page=InfragisticsWPF4.Controls.Editors.XamMaskedInput.v15.1~Infragistics.Controls.Editors.ValueConstraint~Nullable.html
I modified your sample application. I modified your converter and use it to bind your property to the Value of XamNumericEditor. Also you can take a look at the following forum thread, where similar issue was discussed,it can be of help to you: http://es.infragistics.com/community/forums/t/87601.aspx , please let me know If I am missing something from your scenario.
Please let me know if you need any further assistance on the matter.