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?

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello ifdef,

    Thank you for your post!

    I have been investigating into this behavior you are seeing, and I have reproduced it. As of yet, I have not come up with a solution for you, and I am currently looking into this with my colleagues to determine whether this is a bug in the XamNumericInput or not. I will have more information for you on this matter shortly.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

Children