WPF Datagrid 列格式编号以包含逗号 [英] WPF Datagrid Column Format Number to include commas
本文介绍了WPF Datagrid 列格式编号以包含逗号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我认为这会相当简单,而且可能很简单,但我在谷歌上找不到任何东西.我有一个 WPF 应用程序,其数据网格绑定到我的对象,该对象包含类型 bool、string & 的属性.内部int 显示的地方我想显示 30,000 而不是 30000.这是如何实现的?
I thought this would be rather simple and probably is but I cannot find anything on google. I have a WPF application with a datagrid bound to my object which contains properties of type bool, string & int. Where int is displayed I want to show 30,000 rather than 30000. How is this acheieve?
任何帮助都会很棒,谢谢,米
Any help would be great, Thanks, M
推荐答案
您正在寻找 StringFormat
<DataGridTextColumn Binding="{Binding myInt, StringFormat={0:N0}}"/>
或
<DataGridTextColumn Binding="{Binding myInt, StringFormat={}{0:N0}}"/>
这篇关于WPF Datagrid 列格式编号以包含逗号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文