我制作一个listview并将其绑定到CollectionViewSource
<ListView ItemsSource="{Binding Source={StaticResource cvs}}" Name="Flistview" >
<ListView.View>
<GridView>
<GridViewColumn x:Name="FIdcolumn" DisplayMemberBinding="{Binding Id}" Header="Id"/>
<GridViewColumn x:Name="Fpricecolumn" DisplayMemberBinding="{Binding price}" Header="price"/>
</GridView>
</ListView.View>
它是这样的:
Id pirce
1 100
2 200
3 300
如何在每列价格中追加一个字符串?
我想要像这样
Id pirce
1 100 $
2 200 $
3 300 $
答案 0 :(得分:0)
<GridViewColumn x:Name="Fpricecolumn"
DisplayMemberBinding="{Binding price, StringFormat={}{0}$}" Header="price"/>