The issue here is that LostFocus doesn't fire on the source control when Menu or Toolbar buttons are activated. If you save the data at this point, you'll be saving without the last updated value. This means the button events fire, but the data source has not been updated. ![]() But clicking on Menu or Toolbar UI objects, there is no LostFocus event that is fired on the original control. The reason for this behavior is not hard to deduce: Most data binding solutions by default assign control state to the underlying data source when focus to the control is lost. It's an old problem, but one that I repeatedly run into, usually after scratching my head for a bit on why data isn't updating consistently. IOW, it's one of those tricky errors that occurs only sometimes depending on the final input state of the form in question. But then at some point you do make a change on a control and immediately saved using a toolbar/menu/hotkey operation. ![]() This is a nasty problem because in many cases the save operation worked just fine, because the last field you were focused on wasn't changed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |