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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Formating CellValue in CurrencyCell

Thread ID:





5550 Jul 8,2003 11:53 AM UTC Jan 19,2004 04:35 PM UTC WinForms 4
Tags: GridControl
Olivier Choquette
Asked On July 8, 2003 11:53 AM UTC

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

Administrator [Syncfusion]
Replied On 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

Colin Lamarre
Replied On 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

Administrator [Syncfusion]
Replied On 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;

Colin Lamarre
Replied On January 19, 2004 04:35 PM UTC

Sure is great having you around! thanks again!


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon