HI!
I put a numeric editor component in a grid column. The numeric type is Double and I set the MaxValue and the MinValue to Double.MaxValue and Double.MinValue. MaskInput et FormatInfo are null.
But when I go in edit mode to the column in the grid, the column has now a mask input of currency. Why does it happen ? I inspect the column properties and the mask input property is null.
Somebody can explain what happens here ? I use WinGrid 10.2
Best regards,
Benoit
Hello Benoit,
Please let us know if you have any other questions with this matter.Thank you.
Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.
Hi Benoit,
It sounds to me like you need to set the MinValue, MaxValue, and InputMask properties on the grid column and that you do not need to use an Editor here.
The reason for this behavior is that most developers expect the mask to default to one that is appropriate for the data type, since it is impossible to make assumptions about the application's usage of the data type. Most developers use the System.Decimal data type to present currency values to the user as (according to MSDN documentation) it is "appropriate for financial calculations requiring large numbers of significant integral and fractional digits and no round-off errors".
Note that you can override this default setting by setting the MaskInput property to a different value.
Thanks for the reply. It seems to be the problem.
But why does it do something like this? I have a lot of decimal in my database, but they are not always currencies. I use decimal numbers for a lot of purposes such as percentage etc.
The fact that grid "assume" a currency mask input because the data type is decimal causes me more problems than it helps. Moreover, the mask input of the column is null so it should not assume tha this is a currency value.
Most likely the DataType of the underlying DataColumn is System.Decimal, which is why the grid resolves the MaskInput property to a value that is appropriate for that type. You can set it to something else if you don't want a currency mask.