views:

39

answers:

2

Hello,

I have a MainWindow with 3 main buttons at the top and below a MainUserControl.

In the MainUserControl I have at top 3 UserControls with ButtonBars and at the bottom a DataGrid.

When I enter data in a DataGridCell and I click into another cell a property change is fired in my ViewModel bound to the DataGrid.

When I enter data... and I click on one of the 3 main buttons again a property change is fired because of Lost Focus event.

When I ... and I click on one of the buttons in the ButtonBar in the UserControl no property change is fired because there seem to be no Lost Focus event.

How can I fix that?

+1  A: 

If you change your binding to to set UpdateSourceTrigger=PropertyChanged then you will not need to rely on the LostFocus to do a property update.

benPearce
can not do that because when I leave a DataGridCell I do a database update of the changed text in the DataGridCell. If I would change UpdateSourceTrigger from LostFocus to your suggested PropertyChanged I would get many sql inserts for every char you type...
Lisa