Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
23471 | Jan 13,2005 07:26 AM UTC | Jan 13,2005 01:03 PM UTC | WinForms | 1 |
![]() |
Tags: GridControl |
SendKeys.Send("{ESC}");
SendKeys.Send("{ESC}");
This should work as long as the grid has not lost focus. SO, having a menu item or toolbar button to trigger this is OK, but if it is Button on a form that triggers this, you woul dhave to set button1.CauseValidation = false to avoid thr grid losing focus when you click the button to trigget the action.
If this does not work then I thing woul dwoul dhave to call grid.CurrentCell.EndEdit, grid.Binder.EndEdit and then grid.Binder.RemoveRecords. This would finish adding the record so it could then be removed.
There are also DataTable.RejectChanges and DataRow.RejectChanges that can be used to do this as well.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.