changing currency display format dynamically from code

5 posts, 0 answers
  1. Shankar
    Shankar avatar
    4 posts
    Member since:
    Aug 2008

    Posted 24 Aug 2010 Link to this post

    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.
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 25 Aug 2010 Link to this post

    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
  3. DevCraft banner
  4. Shankar
    Shankar avatar
    4 posts
    Member since:
    Aug 2008

    Posted 25 Aug 2010 Link to this post

    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.
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 26 Aug 2010 Link to this post

    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
  6. Vikas
    Vikas avatar
    1 posts
    Member since:
    Dec 2015

    Posted 20 Dec 2015 Link to this post

    It's Very Simple See This Video
    https://www.youtube.com/watch?v=f6AleGoC0U8
Back to Top
DevCraft banner