WPF DataGrid列数的格式,包括逗号 [英] WPF Datagrid Column Format Number to include commas

查看:287
本文介绍了WPF DataGrid列数的格式,包括逗号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想这将是非常简单,可能是,但我找不到任何谷歌。我有绑定到我的对象数据网格包含布尔型,字符串和放大器的性能WPF应用程序; int类型。其中显示INT我想显示30000,而不是30000。这是怎么回事acheieve?

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?

任何帮助将是巨大的,
谢谢,
M

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆