Hello,
how would I implement validation for calculated fields?
AFAIK and tested value constraints only work if the user actually enters a value. But what about calculated fields. For example: Say we have three frields [a], [b] and [c]. [c] is calculated by [a] * [b]. Let's assume that [c] has a mask "nn.nn". Now If [a] and [b] are 10 the result is 100 but the editor displays "00.00".
Is there a way to either empty or display the correct calculated value?
RegardsJohannes
I am just checking if you have any other questions on the matter.
Hi,
When a mask is applied it affects the whole value in the XamNumericEditor. This means that if you need to display a larger number, you could apply a mask that allows larger number of digits before the floating point. If you need to keep the mask as it is, you could use the loaded event as I had suggested in one of my previous posts and change the value of the editor accordingly.
Hi Maria,
Thanks for the reply. However that is not exactly what I was hoping for. With your solution one would still have to specify the digits before the ".". As I mentioned, is it possible to only specify the decimal digits? So in your case only specify the "f" part.
Johannes,
A mask for the floating point input could be set using the {double:-i.f:c} mask characters. This will allow you to set the number of digits before the floating point – i, and the number of digits after the floating point – f. For example <Setter Property="Mask" Value="{}{double:9.2}"/>
Here more information on the available masks can be found: http://help.infragistics.com/Help/NetAdvantage/WPF/2012.1/CLR4.0/html/xamInputs_Masks.html
If you have any other questions, please do not hesitate to ask.
Maybe we can go another route. Is it possible to define a mask that only specifies decimal points? Like so: ".nn". This mask would then accept 1.54 and 1000000000.54.