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
Hey...
Anybody listening to this issue?
Hello Nkaur,
Thank you for your post.
I have been looking into the sample application that you have provided and I am not completely sure that I understand your issue correctly. If this behavior is appear when you delete the value of editor, it is expected because it will return null and will try to save that in the underlying object( because you have set the binding mode to TwoWay and your object is from double instead of double? type). That I can suggest in order to be able to achieve the behavior that you are looking for is to change the type of property from your underlying data that you bind to XamNumericEditor`s value to double? . Please let me know if I am missing something from your scenario and if that is not the case, so I will investigate it further for you.
If you require any further assistance, please do not hesitate to ask.
Hi Zhivko Nikolov,
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.
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.
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.
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.
Thanks for the post.
Thanks for investigating the issue, I will try to upgrade my infragistics soon.
One last query can I show the mask error in tooltip rather than message pop-up.
Thanks in advance.
nkaur
Thank you for your feedback.
I am very glad that my suggestion was helpful for you. Please do not hesitate to ask if you require any further assistance on the matter.
Sorry for the late reply, I was working on some other task lately.
Yes your last post was very helpful. Thank you so much for your time and patience. :)
Hello,
I am just checking if my last reply was helpful for you.
If you require any further assistance please do not hesitate to ask.
I have been looking into your requirement. In order to be able to achieve the functionality that you are looking for you can set the InvalidValueBehavior property of XamNumericEditor to RetainValue, so the editor will retain value and stay in edit mode instead of display the error message. You can read more details about it from 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.InvalidValueBehavior.html
Also you should handle EditModeValidationError event of XamNumericEditor, which raised when the editor has an input validation error(invalid value). In the event handler of this event you can get the editor by sender and set it`s ToolTip property to the ErrorMessage property that derives from EditModeValidationErrorEventArgs and contains the current error message. If you want to set some border when the editor value is invalid you can use the same event set the its BorderBrush property to some Brushes. In order to be able to clear the tooltip and brushes when the editor`s value is correct you can handle ValueChanged event of XamNumericEditor and in the event handler you can determine whether the editor`s value is valid and if it is you can perform the needed operation to clear them. In order to be able to raise these events you should set IsAlwaysInEditMode property of XamNumericEditor to False.
If you need from more details about EditModeValidationError event, please take a look at the following link:
http://help.infragistics.com/doc/WPF/2015.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v15.1~Infragistics.Windows.DataPresenter.DataPresenterBase~EditModeValidationError_EV.html
I modified the last sample application from my post, to show you how you can implement this approach and achieve the functionality that you are looking for.
Please let me know if you need any further assistance on the matter.