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 Reply Children