views:

58

answers:

0

In wpf I setup a tab control that binds to a collection of objects each object has a data template with a data grid presenting the data. If I select a particular cell and put it into edit mode, leaving the grid by going to another tab this will cause the exception below to be thrown on returning the datagrid:

'DeferRefresh' is not allowed during an AddNew or EditItem transaction.

It appears that the cell never left edit mode. Is there an easy way to take the cell out of edit mode, or is something else going on here?

Update: It looks like if I do not bind the tab control to the data source, but instead explicitly define each tab and then bind each item in the data source to a content control this problem goes away. This is not really a great solution, so I would still like to know how to bind the collection directly to the tab control.