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
close icon

Formatting cell text as currency

What's the best way to format cells that initially just contain a decimal number as currency? I assume it's something that would be done in the QueryCellStyleInfo event, but I'm having trouble finding the appropriate property to use to apply the formatting. Anyone have any idea how this should be done?

Thanks,
Kris

3 Replies

RC Rajadurai C Syncfusion Team April 15, 2010 05:28 PM UTC

Hi Kris,

Thanks for your interest in Syncfusion Products.

To display the text of a grid cell in Currency format, you need to the set the GridStyleInfo.CellType property to "Currency". Please refer to our browser sample shipped with Syncfusion Dashboard in the path, Grid samples -> Cell Types -> Currency Cell Demo.

In this sample, the use of this celltype has been illustrated. Also, the format to the currency text with this celltype can be set through GridStyleInfo.CurrencyEdit property.

Regards,
Rajadurai


EV Eric van Dinter June 17, 2010 12:38 PM UTC

Hello,

I have another question about a currency cell.

I want to have a distinction between an empty cell and a cell with value = 0.

How can I arrange that ?

Thanks in advance,

Eric


RC Rajadurai C Syncfusion Team June 18, 2010 02:41 PM UTC

Hi Eric,

Thanks for your interest in Syncfusion Products.

To maintain a distinction between empty cell and a cell with value '0', you can make use of GridStyleInfo.CurrencyEdit.NullString property.

Setting this property to string.Empty will let you mantain a difference between these two cases.

GridStyleInfo style = this.gridControl1[1,1];
style.CellType = "Currency";
style.CurrencyEdit.NullString = string.Empty;


This difference was implemented in our code library and will be available in our upcoming release Volume 3 2010 which can be expected in the mid of July 2010.

Regards,
Rajadurai

Loader.
Live Chat Icon For mobile
Up arrow icon