We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Cancel a row edit

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?

1 Reply

AD Administrator Syncfusion Team October 21, 2004 06:59 PM UTC

Try this code. this.grid1.CurrentCell.EndEdit(); this.1.Binder.EndEdit(); dateTable1.Rows[this.grid1.CurrentCell.RowIndex-1].RejectChanges();

Loader.
Live Chat Icon For mobile
Up arrow icon