I have a simple XamCurrencyEditor bound to a non nullable decimal property.
However, i can simply select the entire content, including the currency symbol and press delete or backspace. I get a red border and my bound property does not update itself Not to 0 and not to null. There is no mention of binding errors in my console.
<igEditors:XamCurrencyEditor Value="{Binding Settings.DecimalProperty, UpdateSourceTrigger=PropertyChanged}"/>
Hell Martin ,
Thank you for your post. I followed the steps you suggested and was unable to reproduce the behavior you're describing using version 20.1.11. I you could attach a sample where this is happening I may be able to better assist you.
Please let me know if I can provide any further assistance.
Here is a sample : file-upload.net/download-14171371/EditorSample.rar.html
Hello Martin,
Thank you for sharing your sample.
We will investigate this matter further and will contact you shortly with more information or questions for you.Please feel free to continue sending updates to this case at any time.
Hello Martin ,
After having a look at your sample, I was able to solve the issue. By setting a value changed event we can track if the value is null and then set it to a desired value (in this case I set it to 10) In addition we will need to implement an notifypropertychanged event to force the UI to update. You will be able to see this in the attached file.
7607.EditorSample.zip
Regards
Nicholas Parr
Hello,
i think we must be misunderatnding each other. Because what i get is that your standard WPF editor, does not work with a Binding. Whats in the editor is not representative of the data.
That is obviously highly unlkely and i can't be the first to notice. There must be some setting we're missing. Whats the point of a currency editor if it doesnt prevent the user from putting in impossible values?
Hi Martin,
I have been investigating into the behavior you are seeing and the best thing I can recommend in this case is that you add a ValueConstraint to the XamCurrencyEditor with the “Nullable” property set to “False.” You can do this using the code below:
<igWPF:XamCurrencyEditor Value="{Binding MyDecimal, UpdateSourceTrigger=PropertyChanged}"> <igWPF:XamCurrencyEditor.ValueConstraint> <igWPF:ValueConstraint Nullable="False" /> </igWPF:XamCurrencyEditor.ValueConstraint> </igWPF:XamCurrencyEditor>
What this will do is if you try to leave the editor and the value is blank, it will throw out a message box saying that the value is empty, prompting the user to enter a valid value, and focus will remain in the editor until this is done.
Regarding the reason why your binding does not update, this is because null is not a valid Value for a bound decimal type, and so the editor gets a red border to designate that the attempted entered value is not valid, and the underlying binding is not updated to reflect that value. Being that the underlying binding is not updated, it will remain as the previous value until a valid value is entered into the editor.
Please let me know if you have any other questions or concerns on this matter.