【问题标题】:Adding a dot separator instead of comma in datagrid column在数据网格列中添加点分隔符而不是逗号
【发布时间】:2017-10-09 10:02:17
【问题描述】:

我有一个数据网格列,它显示数据库中的 int 值。 输出如下所示:

4,561,876。

我需要它看起来像这样:

4.561,876。

我尝试输入 Main() System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(3098); ,但没有显示任何结果。

这是我在 xaml 中为单元格设置的格式:

<DataGridTextColumn Binding="{Binding Ulaz, StringFormat={}{0:n2}}" Width="Auto" Header="Column"/>

【问题讨论】:

  • this 有用吗?
  • Ulaz 属性的实际值和类型是什么?
  • type 是 sql server 数据库中的 int
  • 整数?那么实际值为4561876?所以你基本上想用一个点替换第一个(唯一的)千位分隔符?
  • @Sinatr 就是这样!谢谢!

标签: c# wpf xaml datagrid number-formatting


【解决方案1】:

尝试将xml:langDataGridTextColumn 设置为适当的文化,以在特定文化中设置控件的值。

【讨论】:

    猜你喜欢
    • 2016-07-01
    • 2015-10-15
    • 1970-01-01
    • 2020-07-01
    • 1970-01-01
    • 2020-05-31
    • 1970-01-01
    • 1970-01-01
    • 2021-11-30
    相关资源
    最近更新 更多