We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

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 11:46 AM

> 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 10:22 AM

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 11:30 AM

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 11:35 AM

Sure is great having you around! thanks again!

Loader.
Live Chat Icon For mobile
Up arrow icon