Hi !
I would like that when I insert in a cell a value like "100,000,000" to be interpred by the grid as the number 100000000(one hundred millions) and when I insert a value like "201.33" the "." to be interpreted as "201 integer and 33 decimals" - by default if i use the "." character it just converts to "20133"
Any ideas ?
Thanks!
It sounds like the culture under which you are running uses the decimal (ASCII 46) as the thousands separator, and not the decimal separator.If this is the case you really shouldn't mess around with that because it will confuse users who are familiar with that culture.
Note that if I misunderstood this, and you are simply trying to change the format, you can do that with Format property. An example of a format for showing thousands separators is "###,###.00"
Hi Brian!
Well, it was a direct request from a customer, so it needs to be done.
I know that it might be a little weird, but i need that throughout the grid, when i insert a number , let's say "10000.55" (ten millions) to be formated automaticaly to "10,000.55". other examples :
100.5 => 100.5
10000.123 => 10,000.123
1.3 => 1.3
10000 => 10,000
Is there a way I can do this ?
Hello,
Have you been able to set the Format property like : "###,###.00" as Brian suggested?
Let me know for the result or if you have any further questions.
Thanks Hristo!
Changing it to "###,###,###,##0.##" solved all my issues!
Could you please change column format from "###,###,###,###.##" to "###,###,###,##0.00".
Let me know if you have any further questions.
Thanks Hristo, it was really helpful. I've set the column format to "###,###,###.##" . It does the trick i want, but now i get this -> instead of 0.32 i see only .32
(this happens on a machine that has the culture info set like this : the comma separator is "." and the thousand one is "," )
Thanks
As Brian said this is caused by CurrentCulture of the machine where the application is running. But I have created a sample where next to the grid has a labels which shows what are CurrencyDecimalSeparator and CurrencyGroupSeparator on the machine. In the sample I am changing CurrentCulture to be able to set CurrencyDecimalSeparator and CurrencyGroupSeparator based on your requirements. Also I am setting ultraGrid1.DisplayLayout.Bands[0].Columns[0].Format to "###,###,###,###.00".
I hope this help.
The Format property is not applied when the cell is in edit mode, which is by design. You could probably get the behavior you want using the MaskInput property, although since you are fighting the regional settings, you would have to parse the value yourself since the operating system has an opinion about what character is the decimal separator.
Obviously I don't know the details behind the customer request, but I can't help thinking that it is possible they just don't know how to set the regional settings on their machine, and the simplest solution to their problem is to use a culture that uses the comma as the decimal separator.