I have been searching the forums, and apparently many other folks have run into this same issue. The XamNumericEditor and XamCurrencyEditor seem to default to Decimal data type, which as I understand, only allows up to 9 digits. I have tried changing the data type to double, currency, Int64, etc. with no luck. I am able to type numbers longer than 9 digits in the editor, but as soon as I press Enter or remove focus from the current edited cell, the value gets automatically blanked out. If I only enter 9 digits or less, then the value is preserved in the grid. Also, anything I enter in the decimal spaces gets reset to zeroes when I press Enter or when the editor loses focus.
Thanks in advance for any help.
Here is what I am testing with:
<ig:Field Name="Dollars" > <ig:Field.Settings> <ig:FieldSettings AllowEdit="True" EditAsType="{x:Type sys:Double}"> <ig:FieldSettings.EditorStyle> <Style TargetType="{x:Type ig:XamNumericEditor}" > <Setter Property="Mask" Value="{}{double:12.2:c}" /> <Setter Property="Format" Value="C" /> </Style> </ig:FieldSettings.EditorStyle> </ig:FieldSettings> </ig:Field.Settings> </ig:Field>
Hello Jorge,
I have been investigating into this issue, and using the settings that you have provided, I am currently unable to reproduce this behavior that you are seeing in the XamDataGrid when the cell value blanks out after setting a value longer than 9 digits.
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was made using version 16.2.20162.2045 in Infragistics for WPF 2016 Volume 2.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Sorry about the late reply, and thank you for that sample code.
It does work, but when I copy/paste the same code in our application it goes back to limiting 9 digits and rounding up the decimals. We are on version 13.1, but I have verified that same version works fine if I create a blank demo. There must be something in our application that is overriding that behavior. I just don't know what it could be.
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. I changed it to Double, and everything worked just fine.
Thank you for your response! I am glad that you were able to resolve these issues that you were having with the XamNumericEditor in the XamDataGrid.