Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1685
How to have different currency formats on different rows in a column
posted

I have several numeric columns in my grid where the values could be in different currencies.
They therefore need different formatting at cell level.

At present I am keeping a collection with one UltraCurrencyEditor for each currency:

UltraCurrencyEditor editor = new UltraCurrencyEditor();
editor.MaskDataMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeBoth;
editor.MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiterals;
editor.FormatString = "AC$###,###,###,##0.00";

currencyEditors.Add(row.GetCellValue(currencyColumn).ToString(), editor);

I'm then setting this against the cell:

row.Cells[numericColumn].EditorControl = currencyEditors[row.GetCellValue(currencyColumn).ToString()];

 

This approach seems to use a lot of memory.
Disabling this code almosts halves the entire memory usage for the form.
Is there a better way?

(The values do no need to be edited, it's for display purposes only).