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
155
Preventing rounding decimals in XamCurrencyEditor
posted

We have a XamDataGrid that uses XamCurrencyEditor to edit values right on the grid.

We need to allow users to input/edit currency values that are up to 12 digits long, and we need to prevent the editor from rounding up the decimals.

Currently, anything entered beyond 9 digits gets lost when you press Enter or focus is moved to another control. If you enter 9 digits or less, then the value stays in. The editor does allow entering more than 9 digits, because of the Mask I have declared, but the entire value gets erased when you attempt to enter more than 9.

Also, any decimals entered get automatically rounded up to the nearest dollar, which is definitely not what we want.

How do we prevent these arbitrary unwanted behaviors? We are on version 13.1 of Infragistics.

Thanks in advance for your help.

Here is how we are declaring the controls:

<Style TargetType="{x:Type ig:XamCurrencyEditor}" x:Key="CurrencyStyle" >

<Setter Property="Mask" Value="{}{currency:10.2:c}" />

<Setter Property="Format" Value="C2" />

</Style>

<ig:Field Name="GoalDollars" Label="Dollars">

<ig:Field.Settings>

<jhaCtrls:JHAFieldSettings

AllowEdit="True"

EditAsType="{x:Type sys:Decimal}"

EditorStyle="{StaticResource CurrencyStyle}"

DataValueChangedNotificationsActive="True"

LabelTextAlignment="Right"/>

</ig:Field.Settings>

</ig:Field>

Parents
No Data
Reply
  • 6365
    Verified Answer
    Offline posted

    Hello Jorge,

    Thank you for the description and the code-snippet you have provided.

    I have tested the behaviors you have described in regards to the disappearing digits when typing more than 9 of them and the rounding up of the value when using the XamCurrencyEditor and I was not able to reproduce the issue. (refer to the image inside the .zip file)

    Would you please modify the sample I have attached so the issue is isolated and reproduced? This will help me further investigate this matter for you.

    If you have any questions, please let me know.

    Sample.zip
Children