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

HandleBoundCurrentCellKeyDown IsEditing

Hi there, In GridDataBoundGrid protected override void HandleBoundCurrentCellKeyDown(KeyEventArgs e) { ... else if(e.KeyCode == Keys.Escape && this.CurrentCell.IsEditing && this.CurrentCell.Renderer.CurrentStyle.CellType == FormulaCell) { CurrentCell.RejectChanges(); //CurrentCell.ConfirmChanges(); //only ConfirmChanges will make the CurrentCell.IsEditing = false; CurrentCell.CancelEdit(); CurrentCell.EndEdit(); //CancelEdit and EndEdit is not making the IsEditing false. e.Handled = true; Focus(); } } Can you please suggest how to make IsEditing false in this function because it is again calling the CurrentCell.ConfirmChanges from the base when the another cell is selected. Thank you, Nevin

2 Replies

AD Administrator Syncfusion Team July 4, 2006 07:42 AM UTC

hi, In the above mail the CurrentCell.IsEditing is getting false. But still the grid is calling the Model_SaveCellInfo when the other cell is selected. Can you please suggest something which helps in not calling the Model_SaveCellInfo. Thank you again, Nevin


AD Administrator Syncfusion Team July 4, 2006 03:37 PM UTC

Hi Nevin, Typically this types of error occurs if you are not properly handle CurrentCell.IsModified flag. Without setting the CurrentCell.IsModified = false, your saveCellInfo is called when you leave the cell/the control which means your changes were being saved in the grid. Before calling the CurrentCell.RejectChanges/ AcceptChanges method, you can set the CurrentCell.IsModified flag to false. Here is a code snippet. this.CurrentCell.IsModified = false; this.CurrentCell.RejectChanges(); Let me know if this helps. Best Regards, Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon