Search code examples
c#wpfxamldatagridcurrency

wpf Datagrid currency is alway $


Im making a receipt for a fast food . one column is for price which i try to set it's as currency in xaml like this

 <DataGridTextColumn Header="MenuPrice" x:Name="MenuPrice" 
                                        Binding="{Binding MenuPrice, StringFormat=C2}" Width="100" />

In other places i get euro sign but only in datagrids i get it as dollar . how can i change it to actually follow the users windows configuration ? like other places.

enter image description here

if you see at the buttom i have a label which is the result of total like this

total.toString("c2");

and i get the euro sign but not in datagrid


Solution

  • I believe this is basically a duplicate of this question.

    The chosen answer states:

    I'm not sure if this has been fixed in .NET 4, but WPF has never picked up the current culture when rendering things like currency or dates.

    It also gives a solution.