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
875
Strange results in String-based values for XamCurrencyEditor and XamNumericEditor
posted

I'm encountering some strange behavior in the editor controls and I'm wondering whether (a) it's a bug or (b) if I'm missing some required property settings.

If I set up a currency editor to bind its Value to a numeric property in the ViewModel (and set ValueType accordingly), the control works as expected.

        <igEditors:XamCurrencyEditor ValueType="{x:Type s:Int32}" Value="{Binding TestInt}">
            <igEditors:XamCurrencyEditor.ValueConstraint>
                <igEditors:ValueConstraint MinInclusive="0" MaxInclusive="1000000" />
            </igEditors:XamCurrencyEditor.ValueConstraint>
        </igEditors:XamCurrencyEditor>

However, if I bind the value to a String property in the ViewModel (and set ValueType accordingly) like this:

        <igEditors:XamCurrencyEditor ValueType="{x:Type s:String}" Value="{Binding TestString}">
            <igEditors:XamCurrencyEditor.ValueConstraint>
                <igEditors:ValueConstraint MinInclusive="0" MaxInclusive="1000000" />
            </igEditors:XamCurrencyEditor.ValueConstraint>
        </igEditors:XamCurrencyEditor>

then I get some strange results:

(1) The range checking won't accept valid values within the range, other than the original value from the ViewModel.
(2) The editor content is left justified instead of right-justified.

I believe this is also happening in the XamNumericEditor too.

Please advise.

Thank you,
Jim Honeycutt

Parents
No Data
Reply
  • 35319
    Verified Answer
    posted

    Hello,

     

    I have been looking into your questions and by default the XamCurrencyEditor accepts only numeric values. It you would like to set string values to an editor you can use XamMaskEditor. In you scenario for the XamCurrencyEditor that accepts string value, you can set the ‘ValueType’ to integer as :

     

    ValueType="{x:Type s:Int32}"

     

    If you need any further assistance on this matter, feel free to ask.

Children