DataGrid WPF Version 3.7.10175.16000
I am having the following problem, which appears to be similar to a problem that others have had and for which I have tried their solutions without success.
I have a DataGrid on a page, where the user is in editmode in a cell. They change the value to a bad value, then press a button on the page to SAVE. This causes our custom EndEdit method to be called thereby committing the value to the underlying datastore, and also validates the bad value, returning an error. Now the endedit has been called and the focus was last set to the SAVE button. So the user dutifully clicks back into the cell they were editing to enter a proper value. However, at this point the cell does not enter editmode. There is no cursor in the cell although it appears to be highlighted. The user must then click out of this cell to another cell in the grid, and then click back into the original cell. At this point the cell will properly be in editmode.
I have thought that this problem is that when the SAVE button is pressed, that somehow the existing editmode was not terminated. So when the user clicks into the cell after the button press, the datagrid control still thinks it is in editmode and so it does not start edition. I have tried every possible method to force the full endedit, including ending edit on the grid, on the row, and on the cell. I have used an invoker at various priorities to cause either the endedit or the save/validation to be delayed. I have tried setting the current row to the end and the to the beginning. Nothing works.
If this scenario makes sense maybe someone can suggest what I might do. Perhaps I am looking at this problem the wrong way and the problem is not that endedit did not get called properly. Maybe instead it is just that the cell focus did not change on the button press and the datagrid will only enter edition when focus is first set on a cell.
Thanks.
Marty