K
Kai Siegele
Guest
Hallo Laura, thanks for your tip, but I am affraid it solves only the fist part of my problem, displaying the content of my data object in textboxes. Second I want to react on user inputs in my dataobject and update some properties and as an reaction the state of user controls should be updated. For example I have a form with four textboxes where I can modify the ratings of a customer and a save button. This save button should be disabled as long as the ratings are not correct. For doing this I need a way to connect controls and data object, so that data object knows when the value in control has changed and control knows when property of data object has changed. Using C# this connection is very simple: Just add a description which property of the control corresponds to which property of my dataobject, for example: tbRating1.DataBindings.Add("Text", bindingSource, "Rating1", false, DataSourceUpdateMode.OnPropertyChanged); tbRating2.DataBindings.Add("Text", bindingSource, "Rating2", false, DataSourceUpdateMode.OnPropertyChanged); ... btnSave.DataBindings.Add("Enabled", bindingSource, "IsValid", false, DataSourceUpdateMode.OnPropertyChanged); After writing this few lines of code everything works as pleased. That’s great, isn’t it? Kind regards Kai Siegele
Continue reading...
Continue reading...