views:

117

answers:

1

Hi,

I have a WinForms application with some business objects which implement INotifyPropertyChanged and hook the PropertyChanged event via some controls & BindingSource on the form which raises an event back to my business objects layer...

There's just one issue - everything works fine, except only when the control loses focus. E.G., the user changes some text field, but he has to actually click on some other control somewhere BEFORE he hits the 'save' button (e.g. he has to cause focus on another control).

Is there a way to wire this up to OnClick or something so the change is propogated to my business objects layer as the user types the text (or even after he changed a drop down value) so I don't have to force the user to click on a different text box before he can save?

Googling has lead me nowhere but to examples on how to easily do this in WPF =(. But no WinForms examples...

Please Advise,

Drew

+1  A: 

If you are using Binding class to connect object to UserControl, you may try to set binding's DataSourceUpdateMode to OnPropertyChanged.

Please, note that in this way you are writing data to your object before validation. This may be unsuitable for some tasks.

elder_george
Thanks a lot. This worked great!
dferraro

related questions