Hi,
We're using WinGrid as a base class for a control that can contain a different data type in each cell. So each column isn't tied to just one data type. I have the cell editing working fine with a different editor for each cell, but my problem is with formatting the display of cells that contain currency amounts.
I can set the cell's Style to ColumnStyle.Currency, but that only does the most basic display formatting and doesn't include standard formatting like thousands separators. So a value of $10,000.00 only shows up as "10000.00", which isn't enough formatting for a currency value.
It looks fine while editing; the CurrencyEditor I'm using allows me to set the MaskInput.
And if -- at the column level -- I set the MaskDisplayMode to IncludeLiterals and the MaskInput to "{LOC}$-nnn,nnn,nnn,nnn,nnn.nn", it looks great, but then I'm changing the entire column, which screws up other non-currency values in that same column, so that's no good.
What I'm looking for is a way to get more than the bare bones currency formatting that comes from setting Style = ColumnStyle.Currency ("10000.00") and getting to the more standard formatting (like "$10,000.00"), at the individual cell level. I don't see a MaskInput or MaskDisplayMode at the cell level.
Thanks in advance!
Jim Honeycutt
Thanks Matt, that did the trick!
Jim
Jim,
Instead of setting the Style to ColumnStyle.Currency, try using an UltraCurrencyEditor, setting the FormatString of the control to "c", then using that as the EditorControl of the cell. You should reuse this editor across as many cells as are necessary, for efficiency, though this should give you a way to customize the format string on a cell-by-cell basis.
-Matt