This is a migrated thread and some comments may be shown as answers.

Varying Currency Symbol

1 Answer 146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 19 Nov 2008, 10:14 PM
Hi,

The standard DataFormat String {0:C2} will format a number as a currency, but of course it uses the one and only currency symbol appropriate to the current culture.

When the applicaiton has multiple currencies, I would like to format amounts of money with the appropriate currency symbol.

Effectively each row of data in a dataset which has amounts in "currency" will have the appropriate currency symbol as a column/field.

I have achieved the desired result in one way - by changing the text value of the relevant cells in the ItemDataBound event handler, but this seems a little awkward. I initially wanted to modify the DataFormat string, but can't see how to get to it (it is perhaps too late in ItemDataBound).

I was just wondering whether I had a resonable approach before I start to create many different forms.

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 24 Nov 2008, 12:41 PM
Hi Andrew,

You can apply different DataFormatString for the numeric values in a particular column as shown in this online demo of the product:

http://demos.telerik.com/ASPNET/Prometheus/Grid/Examples/Client/ColumnFormatting/DefaultCS.aspx (see the Currency column in the grid and change the currency symbol using the dropdown list above it)

If you would like to have different currency symbols for values within the same column, you will need to stick with the approach with the ItemDataBound event handler you already discovered. I think that the regular MS GridView control will behave in the same way under such circumstances and generally RadGrid extends its capabilities by providing grouping/filtering/etc. aspects out-of-the-box.

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or