Formating CellValue in CurrencyCell

I want to display decimal number, percentages and currencies in my cells. I thought of using CurrencyCell to display these 3 types and switching the Currency symbol ("$", "%" and "" for decimal) because i want to have control over the number of decimal digits the cell displays (which is not available in the NumericUpDown cell). Is there a way to change the position on the currencySymbol i.e.: "20.00%" instead if "%20.00" or at least change the number of spaces between the symbol and the data? Olivier Choquette

4 Replies

AD Administrator Syncfusion Team July 8, 2003 03:46 PM UTC

> Is there a way to change the position on the currencySymbol i.e.: "20.00%" instead if "%20.00" or at least change the number of spaces between the symbol and the data? > Try setting style.CurrencyEdit.CurrencyPositivePattern = 3; style.CurrencyEdit.CurrencySymbol = '%'; Stefan


CL Colin Lamarre January 19, 2004 03:22 PM UTC

Hi, I was trying: gbcc["Percentage"].StyleInfo.CellType = "Currency"; gbcc["Percentage"].StyleInfo.CellValueType = typeof(System.Double); gbcc["Percentage"].StyleInfo.Format = "C"; gbcc["Percentage"].StyleInfo.CurrencyEdit.CurrencyPositivePattern = 3; gbcc["Percentage"].StyleInfo.CurrencyEdit.CurrencySymbol = "%"; gbcc["Percentage"].StyleInfo.CurrencyEdit.ClipMode = Syncfusion.Windows.Forms.Tools.CurrencyClipModes.ExcludeFormatting; but i keep getting 0.00 % is not a valid value for Double... how can i fix that? Thanks


AD Administrator Syncfusion Team January 19, 2004 04:30 PM UTC

Instead of System.Double, try setting the CellValueType to string. GridStyleInfo style = this.gridDataBoundGrid1.Binder.InternalColumns[1].StyleInfo; style.BackColor = Color.LightGoldenrodYellow; style.CellType = "Currency"; style.CellValueType = typeof(string); style.Format = "C"; style.CurrencyEdit.CurrencyPositivePattern = 3; style.CurrencyEdit.CurrencySymbol = "%"; style.CurrencyEdit.ClipMode = Syncfusion.Windows.Forms.Tools.CurrencyClipModes.ExcludeFormatting;


CL Colin Lamarre January 19, 2004 04:35 PM UTC

Sure is great having you around! thanks again!

Loader.
Up arrow icon