In my MVVM project, I have two text fields, one of which is bound to an integer field with a zero value for my object, and the other to a string field. When the view is loaded, if I enter some value in the text field attached to the row property, I see that its value is updated to the object property.
However, the problem occurs when I enter a value in a text field that is associated with the integer integer value field of my object. If this is a valid integer value, the value is updated. If I put an alphanumeric string bound to the zero integer field of my object in the text box, or if I just leave it blank, then the field with the zero number of my object will not be updated. It still retains everything that was installed earlier.
For example, if I enter the number “7” in a numeric text field, it will be updated to 7. Now, if I change it from “7” to say “7a” or “a7” or “asd”, or leave it blank. The value is still 7, which was an earlier value.
Any work around this problem other than changing the type to NULL?
Thank you for your time...
source
share