troubleshooting Question

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

Avatar of endrec
endrec asked on
.NET ProgrammingC#ASP.NET
10 Comments1 Solution533 ViewsLast Modified:
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>
ASKER CERTIFIED SOLUTION
Alfred A.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros