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
2085
XamCurrencyEditor Accepting Blank Values
posted

I am using XamCurrencyEditor as the cell editor in a template column which uses a data type of "decimal?".  When the value in the cell is blanked out, the cell reverts back to the original value.  I suspect the XamCurrencyEditor validation fails when the data entered is blank and instead of setting the data value behind the cell to null, it reverts back to the previous value.

How can I configure XamCurrencyEditor to allow blank input and set the underlying data value to null?

My XAML looks like:

            <ig:XamGrid.Resources>
 
            <Style TargetType="{x:Type igEditors:XamCurrencyEditor}">
                <EventSetter Event="GotFocus" Handler="XamCurrencyEditorGotFocus"/>
                <Setter Property="Mask" Value="{}{currency:-4.2}"/>
                <Setter Property="BorderThickness" Value="1,1,1,1" />
            </Style>

Parents
No Data
Reply
  • 34510
    Offline posted

    Hello Gary,

    As long as the property that is bound to the XamCurrencyEditor is a nullable type it should accept an empty value.  I just tested this and it behaved this way.  You can find my sample attached.

    Can you modify my sample to reproduce your issue so I can see what is happening?

    WpfApplication1.zip
Children