Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
435
Zero Integer as Empty String
posted

Hi Infragistics,

We have a scenario where we would like to display a value of 0 as an empty string using the XamNumericInput

We've achieved this elsewhere by use of a converter.

So we attempted to use this converter in a XamNumericInput but it doesn't appear to be working.

The converters have been specified in a Style like so...

<Style x:Key="XamNumericInputContractNumber" TargetType="{x:Type ig:XamNumericInput}">

    <Setter Property="Width" Value="80"/>

    <Setter Property="ValueTypeName" Value="Int32"/>

    <Setter Property="PromptChar" Value=""/>

    <Setter Property="InvalidValueBehavior" Value="RevertValue"/>

    <Setter Property="ValueConstraint">

        <Setter.Value>

            <ig:ValueConstraint ValidateAsType="Integer32" MinInclusive="0" MaxInclusive="2147483647"/>

        </Setter.Value>

    </Setter>

    <Setter Property="ValueToTextConverter" Value="{pcWPF:ZeroIntegerToStringConverter}"/>

    <Setter Property="ValueToDisplayTextConverter" Value="{pcWPF:ZeroIntegerToStringConverter}"/>

</Style>

The ValueToDisplayTextConverter appears to be working (when displaying) but not the ValueToTextConverter (when editing)

Please could you confirm this is a bug?

Is there another way to achieve this behaviour using either Mask, Format or FormatProvider?