Search code examples
infragistics

UltraNumericEditor doesn't show zero value


this is my first experience with Infragistics components. I have WinForm project with form including UltraNumericEditor with this setting:

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

On component is no event. If I want to write into "text box" 0 (zero), text box is empty, I don't see any char, but in code behind this component return right value.

Other numbers are allright and I don't know why. Does anyone experience with this behavior?


Solution

  • that is because you use '#' as Formatstring

    you have to use something like

    ### ### ##0.00
    

    or

    n2
    

    or

    C2' for currency
    

    this is from msdn

    Replaces the "#" symbol with the corresponding digit if one is present; otherwise, no digit appears in the result string.

    here is a link for better understanding

    Custom Numeric Format Strings