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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Delete button cannot function

Thread ID:





53772 Dec 20,2006 06:51 AM UTC Dec 21,2006 01:18 AM UTC WinForms 2
Tags: GridControl
Ngurah Wirawan
Asked On December 20, 2006 06:51 AM UTC

Hi all,

if we try to type something on the cell, and try to press delete button, there is nothing happen. i have attached simple program to replicate my issue.



Administrator [Syncfusion]
Replied On December 20, 2006 10:22 AM UTC

Hi Wirawan,

If you want to handle the "Delete" Key stroke in a grid cell, you need to handle the CurrentCellKeyDown event of the grid. Here is a code snippet to show this.

private void gridDataBoundGrid1_CurrentCellKeyDown(object sender, KeyEventArgs e)
if(e.KeyCode == Keys.Delete )
GridDataBoundGrid _grid = sender as GridDataBoundGrid;
GridCurrentCell _currentCell = _grid.CurrentCell;
if( _currentCell.IsEditing)
GridTextBoxCellRenderer _Renderer = _currentCell.Renderer as GridTextBoxCellRenderer;
if( _Renderer != null)
e.Handled = true;
int iSelectionLength = _Renderer.TextBox.SelectionLength;
_Renderer.TextBox.SelectionLength = iSelectionLength > 0 ? iSelectionLength : 1;
_Renderer.TextBox.SelectedText = String.Empty;

Please refer to the attached sample for more details.

Best Regards,

Ngurah Wirawan
Replied On December 21, 2006 01:18 AM UTC

Thanks Haneef, it's working.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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