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
2085
XamNumericEditor Optional Fields and Select
posted

I am trying to use XamNumericEditor to achieve the following:

I want to limit input to be a nullable decimal number - when I blank the field, the decimal? bound to the control is set to null.

I want the control to be an optional field - right now, the control shows a red boarder when it has not been filled in, indicating to the user this is a required field.

Here is the XAML I currently have, but does not work based on the features above (note Config.MaxErrorPercent is a decimal? type):

                <igEditors:XamNumericEditor Text="{Binding Config.MaxErrorPercent, Mode=TwoWay}" Mask="nnn.nnnnnnnnnnnnnnnnnn" Format="###.##################" HorizontalContentAlignment="Right" HorizontalAlignment="Center" VerticalAlignment="Center" Width="50" Margin="5">
                    <igEditors:XamNumericEditor.ValueConstraint>
                        <igEditors:ValueConstraint MinInclusive="0" MaxInclusive="100" Nullable="True" ValidateAsType="Decimal"/>
                    </igEditors:XamNumericEditor.ValueConstraint>
                </igEditors:XamNumericEditor>

Parents
No Data
Reply
  • 18204
    Suggested Answer
    Offline posted

    Hi Gary,

    Thank you for posting in our forums!

    From your code snippet, you are binding to the Text property of the XamNumericEditor.  If you instead bind to the Value property, this should be working as you expect.

    Please let me know if you need any further assistance with this and I will be glad to help.

Children