Databinding in Winforms useless?

Posts   
 
    
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 14-Apr-2008 21:57:49   

New Version of LLBLGen ( i just downloaded and installed about 4 min ago)

I have a form, where i have a few textboxes bound to an AddressEntity. If i clear one field and then tab over to the next, and modify that field, when i tab to the next field, the first field goes back to its inital value!! I have tried setting the binding to OnPropertyChanged and that has had no effect. I also tried manually binding NOT using a BindingSource and im getting the same result....any ideas?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 14-Apr-2008 22:33:29   

COuld you try setting breakpoints in the setter of the property corresponding to the field you're changing? It's likely the control reverts the values, not the entity.

Frans Bouma | Lead developer LLBLGen Pro
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 14-Apr-2008 23:01:05   

Ok,

When i delete whats in the textbox, the textbox sends null to the AddressEntity. Everything is ok so far. Its sending null to a property of type string on the AddressEntity. Now the addressentity doesnt accept, as far as i can tell it doesnt throw an error, but doesnt set the value to null either. It just retains its old value....im guessing this is becuase the field is marked as not nullable in the DB?

If i change my textbox to NOT nullable, then the textbox sends an empty string and everything is peachy...so, any field that is not nullable i will jsut do this simple_smile