1910
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
  • 17824
    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.

Reply Children