UltraNumericEditor不显示零值

问题描述 投票:0回答:1

这是我第一次使用Infragistics组件。我的WinForm项目的表单包含带有此设置的UltraNumericEditor:

FormatString: ### ### ###.##
MinValue: 0
Nullable: true
NullText: [N/A]
NumericType: Double
TabNavigation: NextControl

在组件上没有事件。如果我要写入“文本框” 0(零),则文本框为空,我看不到任何字符,但在此组件后面的代码中返回正确的值。

其他数字都可以,我不知道为什么。有没有人遇到这种行为?

infragistics
1个回答
2
投票

那是因为您将'#'用作Formatstring

您必须使用类似的东西

### ### ##0.00

n2

C2' for currency

来自msdn

如果有数字,将“#”符号替换为相应的数字;否则,结果字符串中不会出现数字。

这里是一个更好理解的链接

Custom Numeric Format Strings

© www.soinside.com 2019 - 2024. All rights reserved.