Binding in TemplateColumn.CellTemplate fails until row committed

Apr 2, 2009 at 2:21 PM
I have a DataGridTemplateColumn with a CellTemplate and a CellEditingTemplate both binding to the same property of my data object.
After changing the property's value in edit mode when I tab into the next column the cell returns to non-editing mode as expected.

The problem now is that the values in my cell now jump back to the original values. I suspect the binding of the CellTemplate now binds to the outdated value of the data object until I finish editing the row which commits the changes and updates the binding. So only after leaving the row the binding updates properly.

I wonder how the built-in columns like TextboxColumn and CheckboxColumn manage to display the correct values all the time?
How can I achieve this for my TemplateColumn?
Coordinator
Apr 3, 2009 at 2:24 AM
Take a look at this post, http://blogs.msdn.com/vinsibal/archive/2008/08/19/wpf-datagrid-stock-and-template-columns.aspx.  In particular the section on Template Columns.  It shows how to set the bindings to properly work for the editing scenario.
Apr 3, 2009 at 8:54 AM
Thanks for the simple solution.
I only had to set UpdateSourceTrigger=PropertyChanged in the editing template binding.