Hi,
I am getting the following errors on DoubleEditBox and Int16EditBox:
System.Windows.Data Error: 6 : 'SystemConvertConverter' converter failed to convert value '<null>' (type '<null>'); fallback value will be used, if available. BindingExpression:Path=AdditionalRates.AdditionalRates.SaturdayRate; DataItem='RatesViewModel' (HashCode=45742585); target element is 'DoubleEditBox' (Name='txtSaturdayFlat'); target property is 'Value' (type 'Nullable'1') InvalidCastException:'System.InvalidCastException: Null object cannot be converted to a value type.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at MS.Internal.Data.SystemConvertConverter.Convert(Object o, Type type, Object parameter, CultureInfo culture)
at System.Windows.Data.BindingExpression.ConvertHelper(IValueConverter converter, Object value, Type targetType, Object parameter, CultureInfo culture)'
System.Windows.Data Error: 6 : 'SystemConvertConverter' converter failed to convert value '<null>' (type '<null>'); fallback value will be used, if available. BindingExpression:Path=AdditionalRates.AdditionalRates.SaturdayPercent; DataItem='RatesViewModel' (HashCode=45742585); target element is 'Int16EditBox' (Name='txtSaturdayPercent'); target property is 'Value' (type 'Nullable'1') InvalidCastException:'System.InvalidCastException: Null object cannot be converted to a value type.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at MS.Internal.Data.SystemConvertConverter.Convert(Object o, Type type, Object parameter, CultureInfo culture)
at System.Windows.Data.BindingExpression.ConvertHelper(IValueConverter converter, Object value, Type targetType, Object parameter, CultureInfo culture)'
My property SaturdayRate is a Nullable<Decimal> and my SaturdayPercent is a Nullbale<int>
xaml code is:
<editors1:DoubleEditBox Name="txtSaturdayFlat"
Grid.Column="3" Grid.Row="2" Margin="5,5,0,5"
Width="55" SpinnerVisibility="Collapsed"
IsEnabled="{Binding AdditionalRates.SaturdayFlatRateInputIsEnabled, Mode=TwoWay}"
Format="F2" Value="{Binding AdditionalRates.AdditionalRates.SaturdayRate, ValidatesOnDataErrors=True}"
IsNullAllowed="True"
GotFocus="txtSaturdayFlat_GotFocus"
IsReadOnly="{Binding AdditionalRates.IsReadOnlyData, Mode=TwoWay}" />
<editors1:Int16EditBox Name="txtSaturdayPercent"
Grid.Column="6" Grid.Row="2" Margin="5,5,0,5"
Width="40" SpinnerVisibility="Collapsed"
IsEnabled="{Binding AdditionalRates.SaturdayPercentInputIsEnabled, Mode=TwoWay}"
Value="{Binding AdditionalRates.AdditionalRates.SaturdayPercent, ValidatesOnDataErrors=True, Mode=TwoWay}"
IsNullAllowed="True"
GotFocus="txtSaturdayPercent_GotFocus"
IsReadOnly="{Binding AdditionalRates.IsReadOnlyData, Mode=TwoWay}"/>
Please note the controls and program are operating as expected. The error messages are being displayed in the output window and I'm trying to clear up the errors.