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.
Syncfusion Feedback

Backspace key

Thread ID:

Created:

Updated:

Platform:

Replies:

60887 May 14,2007 09:02 PM UTC May 15,2007 10:24 PM UTC Windows Forms 1
loading
Tags: Grouping
Natalija Ilic
Asked On May 14, 2007 09:02 PM UTC

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 10:24 PM UTC

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.
http://www.syncfusion.com/Support/Forums/message.aspx?&MessageID=26118

Best Regards,
Haneef

CONFIRMATION

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.

Warning Icon 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.Close Icon

;