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>
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.
Thank you for that sample. Indeed it works, but when I copy/paste the same code in our application, it goes back to misbehaving. Limits to 9 digits and rounds up the decimals.
This proves there is something in our application that is inheriting or overriding the behavior. I checked the DLL versions for Infragistics, and they are the same, so I am not sure what else could be doing that.
I finally found the problem!!!
It was the data type we were using for the dollar column. It was set to Integer in the class declaration. The moment I changed it to Double, everything worked just fine.
Thank you for your feedback.
I am glad to know that you were able to achieve the functionality you were aiming for.