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?
I tried the following without success:
e.Layout.Bands[0].Summaries["ssalepr"].DisplayFormatProvider = CultureInfo.CurrentCulture;
e.Layout.Bands[0].Summaries["ssalepr"].DisplayFormat = "{0:n0}";
and I tried just {0} but it did not work either.
Hi,
Your question doesn't really have anything specifically to do with the grid. The way the format works is that the grid just calls ToString on the value and passes in the format. I'm not sure if there are localized formats, but if so, it would depends on the data type of your summary.
Standard Numeric Format Strings
Custom Numeric Format Strings
Also, I think if you don't specify any format at all, then the summary value will pick up the format from the system settings. I'm guessing that maybe you are using the DisplayFormat just to remove the text that appears by default before the summary value. So in that case, you would just do this:
e.Layout.Bands[0].Summaries["myColSum"].DisplayFormat = "{0}";