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.
Hi Hristo!
I've set the format like this :
ulgPricesContract.DisplayLayout.Bands[0].Columns["PRC"].Format = "###,###.00";
after that i entered the cell an inserted the value "1000000.2".
after leaving the cell i got this :
after clicking again on the cell i got this :
after clicking again in outside the cell :
someting weird it's happening here, sterting from the fact that even if i set the format to "###,###.00" the thousands separator it's dot and not comma.
Any ideea on what is happening here ?
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.
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