We help IT Professionals succeed at work.
Get Started

How can I display a currency value that is different than the user's culture in a templated grid item?

endrec
endrec asked
on
530 Views
Last Modified: 2013-11-07
I wanted to know if there is an event/method for templated ASP.NET datagrid items where I can specifically set the culture that values are rendered in.

Example:  The user is viewing the page in Japanese, but all prices need to be listed as US prices with the $ currency while all other resources need to still be in Japanese.  For a specific datagrid and templated column, how can I set the culture that a particular column's values are rendered under.

Currently code like the following would show a price of 30 as 30¥ instead of $30.

<asp:TemplateColumn HeaderText="Example">
  <ItemTemplate>
    <asp:Label ID="PriceLabel" runat="server" Text='<%# Eval("Price", "{0:C}") %>'></asp:Label>
  </ItemTemplate>
</asp:TemplateColumn>
Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 10 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE