【问题标题】:RadGrid not displayning 0 value when setting GridNumericColumn DataFormatString?设置 GridNumericColumn DataFormatString 时,RadGrid 不显示 0 值?
【发布时间】:2014-06-07 11:02:26
【问题描述】:

在设置 GridNumericColumn 的 DataFormatString 时,我的 RadGrid 未显示 0 值。使用此代码时,如何在 RadGrid GridNumericColumn 中显示 0 值?

<telerik:GridNumericColumn UniqueName="Discount" DataField="Discount"
    HeaderStyle-Width="10%" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
    DataFormatString="{0:###,###,###}" FooterAggregateFormatString="{0:###,###,###}">
    <HeaderStyle HorizontalAlign="Right" Width="10%"></HeaderStyle>
    <ItemStyle HorizontalAlign="Right" Width="10%"></ItemStyle>
</telerik:GridNumericColumn>

【问题讨论】:

  • 你试过了吗:DataFormatString="{0:N0}" 你在单元格中输入0了吗?
  • 解决了吗?出了什么问题?
  • 是的。它解决了我的问题。
  • 当我在 radgrid 中设置 0 值时,它不显示 0
  • 但现在是正确的,采用这种格式 {0:N0}

标签: c# asp.net telerik radgrid


【解决方案1】:

尝试使用 DataFormatString="{0:###,###,##0}" 如果存在 1,则将 0 替换为相应的数字;否则,结果字符串中将出现零。因此,如果您的值为 0,则应相应显示。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多