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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

textbox cell and delete key

Thread ID:





14327 May 25,2004 11:17 AM UTC May 25,2004 11:44 AM UTC WinForms 1
Tags: GridControl
Philip Bishop
Asked On May 25, 2004 11:17 AM UTC

I had a question regarding the pressing of the delete key and how it reacts in a textbox cell versus a currency cell. when u use the delete key in a single currency cell it will put a zero in the cell for you somehow. does it do this because its a currency cell??? can u change this value???? if u have many cells selected and hit delete then it goes to my clearingcells event where I put the zero in all the cells. in a textbox cell its works the same on many cells and goes to my clearing cells event and zeros out all the cells. however if i click delete on a textbox single cell it just deletes out the value. now i''m assuming it does this because its not a currency box. is there any way to make the text box cell put a zero or whatever i want when the user hits the delete key in the cell. i cant seem to find where the delete key is doing this on a currency cell and was hoping i could make the textbox cell act like the currency box cell Thanks Phil

Administrator [Syncfusion]
Replied On May 25, 2004 11:44 AM UTC

I think you can catch the delete key in this situation using the CurrentCellKeyDown event.
private void gridControl1_CurrentCellKeyDown(object sender, KeyEventArgs e)
	if(!this.gridControl1.CurrentCell.IsEditing && e.KeyCode == Keys.Delete)
		e.Handled = true;
		GridCurrentCell cc = this.gridControl1.CurrentCell;
		this.gridControl1[cc.RowIndex, cc.ColIndex].Text = "0";


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

Live Chat Icon For mobile
Live Chat Icon