I have an issue with canceling an edit of a row in a data bound grid. I have a dataset table bound to a grid.
If I edit a cell in the grid and move to another editable cell in the same row I cannot cancel that edit. I see the “pencil” icon for that row. However, if I move to a read only cell in that same row or to another row, I can cancel the edit.
What I am doing is rejecting the changes in the dataset for the row I am editing:
dsData.TABLE_NAME.Rows(grid.CurrentCell.RowIndex - 1).RejectChanges()
If I run this code while the row is in edit mode you do not see and changes in the grid until you move off the row. Then you see the edited cells roll back. How can I get the grid to cancel the row edit so I see the roll back in the grid when I reject the changes for the row in the dataset?