WPF ListView Thousand Separator
I want to display numbers in thousands of separated formats. The numbers are displayed in the column of the ListView control. I have the following xaml code but it doesn't even compile!
<GridViewColumn Header = "Total" DisplayMemberBinding = "{Binding PaidValue, StringFormat = {0: 0,0}}" />
From my C # point of view, {0: 0,0} is the correct format to do this, right? What's wrong with that?
The error is completely unrelated: "Unknown build error," Key cannot be empty "pointing to the same line of xaml code If you have tried other variations of the same format without using.
a source to share
Ok I found a way to do this. I have to say that I actually have SP1 installed as many blog posts imply that {0: c} should work, which it doesn't and will result in the same compile time error! This is how I did it:
<GridViewColumn DisplayMemberBinding="{Binding Path=PaidValue, StringFormat='0,0'}" />
Will compile and run without issue. I wonder if there are still StringFormat binding values ββleft.
a source to share