I am using v15.2 win grid
We are using custom culture information. I can set the columns format and formatinfo appropriately, however when it comes to setting the summary displayformat for a column, the formatting does not come out correctly.
Currently this is what I tried but it does not format correctly for the culture I am trying to test.
e.Layout.Bands[0].Summaries["myColSum"].DisplayFormat = "{0:n}";
I have used "{0:##,##0}", but that does not format the display to the correct culture.
How do I get this to work?
That makes sense. If you went into you regional settings and explicitly changed the thousands separator or the digit separator, it would use whatever your machine defines. :)
Thanks Mike for the sample. It turns out it may be related to my laptops regional settings. A couple of the other developers are seeing the information fine with the formatting. I am going to close this issue and move on.
Hi,
So if you are using "n0", then your summary will never display a decimal point. Therefore, the only affect culture would have on your summary is the thousands separator.
So I created a test app the formats a decimal value in both a cell and in a summary and where you can experiment with different formats and choose between two cultures. I chose US-English (because that's the default on my system) and German. I picked German because I happen to know that German uses a decimal point (.) instead of a comma (,) for the thousands separator.
And this works fine for me. When running under US English culture, the summary is displayed using a comma as the separator and when run under German culture, the summary shows with a decimal point as the separator.
I am attaching my sample here so you can try it out. It's a little hard to see the change between the comma and the decimal point, but it's definitely working correctly.
The code you posted here is just passing in the current culture - which essentially does nothing, since that's the default. So I'm a little confused about what's not working or what the problem is.
So I'm a little fuzzy on exactly what is "not working" for you.
Hi Mike,
I realize its not the grid. The underlying datatype is decimal for the column.
Again... this is nothing to do with the grid. You could try the same thing using any value in code. My guess is that "n0" simply isn't a localizable format.The Dotnet framework handles the formatting.
What's the DataType of the column you are trying to format?