I am having difficulty setting an empty text field to zero in a field with zero DB.
Xaml
<y:TextBox Text="{Binding Year1Cost, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, StringFormat=\{0:c\}}" Grid.Row="3" Grid.Column="1" />
When I enter any value into it, the binding is fine and the transmitted value is transmitted
When I leave only one null value, the null value is passed. If I delete the value from the TextBox, the passed value will be the original value of the text field and the user interface will not be notified of the change. Grrrrrrrrrrrrrrrr
For a long time I checked the options, not to mention putting the code behind the OnTextChanged of each field with a zero value, I donβt see the effectiveness at the same time.
Thanks in advance:
ps. Didn't look at TargetNullValue
Visual Studio 2008 - SP1 -.Net 3.5
null data-binding wpf textbox
Traci
source share