Hi,
I am new to the Infragistics controls and I am attempting to use XamNumericEditor to edit a numeric input field. The default value for this field comes from a database value which is a decimal. My xaml code is below.
<ig:XamNumericEditor Grid.Row="2" Grid.Column="1" Value="{Binding OrderQuantity, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, UpdateSourceTrigger=Explicit}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4,0,0,0" Mask="{}{double:10.3}" ValidationMode="Always" />
My problem is that I am getting the following error message when I run the application: System.ArgumentException: The new assigned value: 0 is not of specified type: Double. Is there another editor I should be using if I can't bind to a decimal value when using XamNumericEditor?
Thank you.
Hello AL725 ,
I have been looking through your question and the issue is in the mask that you are using. There you are specifying a double number, but in the data source you are providing a decimal value. In the following link you will find an information on masks, please refer to it in order to set your mask to a proper content:
http://help.infragistics.com/NetAdvantage/Silverlight/2011.2/CLR4.0/?page=xamInputs_Masks.html
Please in case of future concerns do not hesitate to contact us.
Sincerely,
Ekaterina
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support
Hello AL725,
I am checking if this is still an issue for you.
If you require any further assistance please do not hesitate to ask.
Infragistics
No, I do not require any further assistance. Thank you.
Hello,
I am just checking if you require any further assistance on the matter.
Thank you for your answer.
I am very glad you have manage to solve you issue.
As to your new question, in order to set a mask that can be applied on a decimal values you can use the decimal place holder (“.”). For more information regarding masks please refer to the link provided in the post above:
Please let me know if you need further assistance regarding the discussed matter.
It's not an issue anymore for me since I'm using a converter in order to convert the decimal value to a double. However, I was wondering why the XamNumericEditor cannot bind to decimal values directly - it seems that XamNumericEditor can only use a double mask, not a decimal mask. Is that true?