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.
Unfortunately, activation email could not send to your email. Please try again.

BindingList and ESC key

Thread ID:





60851 May 14,2007 06:10 AM May 14,2007 05:26 PM Windows Forms 1
Tags: GridControl
Asked On May 14, 2007 06:10 AM


we are using custom data binding in conjunction with the GGC. Our business object is derived from BindingList. Now when I click in a "append new row" cell and press a key, the AddNew method of the binding list is called and a new item is added to the list.

The problem occurs when I press ESC during this operation. I would expect, that the item is removed from the binding list because the add new row is canceled in the grid. But this is not the case - the item still exists in the binding list. I have attached a sample where you can see the behavior.



haneefm [Syncfusion]
Replied On May 14, 2007 05:26 PM

Hi Steve,

You can handle the TableControlCurrentCellKeydown event and call RemoveAt method to remove the record at specified position in a list. Below is a code snippet

void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, GridTableControlKeyEventArgs e)
if (e.Inner.KeyData == Keys.Escape)
Element el = e.TableControl.Table.CurrentElement;
if (el is GridAddNewRecord)
MyTable a = this.gridGroupingControl1.DataSource as MyTable;
a.RemoveAt(a.Count -1);


Here is a sample.

Best regards,


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.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.