Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
XamNumericEditor cannot bind decimal value to ValueConstraint
posted

I'm trying to bind a decimal value (SalePrice) from my database to the MaxInclusive property of a ValueConstraint like this:

<Label Margin="0,0,4,0" Content="{Binding Path=SalePrice}"/>
<igEditors:XamNumericEditor x:Name="xnumAmountSaleRefunded">
   <igEditors:XamNumericEditor.ValueConstraint>
       <igEditors:ValueConstraint ValidateAsType="Decimal" MinInclusive="0" MaxInclusive="{Binding Path=SalePrice, Mode=OneWay}"  />
   </igEditors:XamNumericEditor.ValueConstraint>
</igEditors:XamNumericEditor>

I added a lable just above the XamNumericEditor just to verify that the binding to SalePrice works, and it does.  It shows a value of 24.95 when run.

The SalePrice field in the SQL database is defined as Decimal(10,2).

The problem is that the constraint just doesn't seem to do anything.  I can enter any max value and it doesn't catch it.

If I change it to say MaxInclusive="24.95", of course it works.  I've tried it with and without the Mode=OneWay, and  I've also tried changing the ValidateAsType to Float, Double, Unknown, even Integer64 and a few others and nothing seems to work.

What am I doing wrong?

Parents Reply Children