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

changing currency display format dynamically from code

4 Answers 821 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Shankar
Top achievements
Rank 1
Shankar asked on 24 Aug 2010, 12:50 PM
Hi,

I need to display the currency values display format(i.e. currency symbol) in a column in the gridview.  

Can anyone please tell me how to change the currency symbol dynamically from code.

Thanks in advance.


Thanks & Regards,
Shankar.

4 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 25 Aug 2010, 09:44 AM
Hi Shankar,

To achieve desired result you have to set the DataFormatString property for that column in code behind based on appropriate culture,I would also suggest you to see the following forum thread.

Regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Shankar
Top achievements
Rank 1
answered on 25 Aug 2010, 01:08 PM
Hi,

What i want is, i need to change the currency symbol dynamically from code behind.   The currency symbol changes with the user selection of currency type.  Right now, i am able to format the currency, but it is always displayed as dollar.   I need to change it to 
GBP, Euro etc.

Sorry!  I was not clear enough in my previous post.


Thanks, 
Shankar.
0
Maya
Telerik team
answered on 26 Aug 2010, 08:53 AM
Hello Shankar,

You still can use DataFormatString Property of the column to set the currency you need. For example:

private void Button1_Click(object sender, RoutedEventArgs e)
{
    var column = this.playersGrid.Columns[1] as GridViewDataColumn;
    column.DataFormatString = "{0:N2}£";
}
 
private void Button2_Click(object sender, RoutedEventArgs e)
{
    var column = this.playersGrid.Columns[1] as GridViewDataColumn;
    column.DataFormatString = "€{0:N2}";
}

 

Sincerely yours,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Vikas
Top achievements
Rank 1
answered on 20 Dec 2015, 08:51 PM
It's Very Simple See This Video
https://www.youtube.com/watch?v=f6AleGoC0U8
Tags
GridView
Asked by
Shankar
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Shankar
Top achievements
Rank 1
Maya
Telerik team
Vikas
Top achievements
Rank 1
Share this question
or