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.

Backspace key

Thread ID:





60887 May 14,2007 05:02 PM May 15,2007 06:24 PM Windows Forms 1
Tags: Grouping
Natalija Ilic
Asked On May 14, 2007 05:02 PM

I have AutoComplete comboBox inside GridGrouping Control. When the cursor is inside the field it seems that Backspace and Delete doesn't work like with other text fields.
Do I need to override TableControlCurrentCellKeyDown event for Backspace and Delete keys? Do you have any examples?

Thanks a lot.

haneefm [Syncfusion]
Replied On May 15, 2007 06:24 PM

Hi Natalia,

This can achieved by handling the CurrentCellKeyDown event and accordingly the Delete key is processed for the combobox cell to resolve this issue. The following is the code snippet.

private void gridTableControlCurrentCellKeyDown(object sender,GridTableControlKeyEventArgs e)
GridCurrentCell cc =e.TableControl.CurrentCell;
if(cc.Renderer.StyleInfo.CellType == GridCellTypeName.ComboBox )
if(e.KeyCode == Keys.Delete || e.KeyCode == Keys.Back)
e.Inner.Handled = true;
GridDropDownEditPartControl editControl = cc.Renderer.Control as GridDropDownEditPartControl;
int len = ( editControl.SelectionLength > 0 )? editControl.SelectionLength : 1;
int start = editControl.SelectionStart;
if( ( editControl.SelectionStart + len ) <= editControl.Text.Length)
cc.Renderer.ControlText = cc.Renderer.ControlText.Remove( editControl.SelectionStart,len);
editControl.SelectionStart = start;

Also refer this forum thread for more details.

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.