Hello,
I am using the NumericUpDown with a binding to a nullable short property on my ViewModel. The NumericUpDown is declared as follows
And the ViewModel property is defined as
However, the value that is displayed on load is a 0. I put a breakpoint in the getter of the property and it is indeed returning null.
What am I missing here?
Thanks.
I am using the NumericUpDown with a binding to a nullable short property on my ViewModel. The NumericUpDown is declared as follows
<
telerik:RadNumericUpDown
Value
=
"{Binding Path=CurrentOEMOriginalQuantity, ValidatesOnDataErrors=True}"
Grid.Row
=
"1"
Grid.Column
=
"2"
Margin
=
"0,0,2,0"
NumberDecimalDigits
=
"0"
UpdateValueEvent
=
"PropertyChanged"
ShowButtons
=
"False"
NullValue
=
""
/>
And the ViewModel property is defined as
public
short
? CurrentOEMOriginalQuantity
{
get
{
if
(adapter ==
null
|| adapter.CurrentOEMOriginalCost ==
null
)
return
null
;
else
return
adapter.CurrentOEMOriginalCost.QuantityOnHand;
}
set
{
if
(adapter ==
null
|| adapter.CurrentOEMOriginalCost ==
null
)
return
;
adapter.CurrentOEMOriginalCost.QuantityOnHand =
value;
RaisePropertyChanged(() =>
this
.CurrentOEMOriginalQuantity);
}
}
However, the value that is displayed on load is a 0. I put a breakpoint in the getter of the property and it is indeed returning null.
What am I missing here?
Thanks.