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

KeyDown event doesn`t get fired at GDBG

Thread ID:





44394 May 23,2006 09:06 AM UTC May 23,2006 10:17 AM UTC WinForms 3
Tags: GridControl
Asked On May 23, 2006 09:06 AM UTC

Hi, I want to avoid deleting rows from a GridDataBounGrid using delete key, so i implemented the KeyDown event. The problem is that this event is only fired when keys are pressed when editing certain cells, but not in other cells or when the grid is not being edited. How can i avoid the deletion of rows using delete key? (by implementing KeyDown or whatever). Thank you

Administrator [Syncfusion]
Replied On May 23, 2006 09:23 AM UTC

Hi Borja, You need to set the Binder''s EnableRemove property to false. A value of EnableRemove property indicating if the grid supports removing records if the underlying datasource allows it. Here is a code snippet. this.gridDataBoundGrid1.Binder.EnableRemove = false; Please let me know if this helps. Best Regars, Haneef

Replied On May 23, 2006 09:55 AM UTC

Thank you, it resolved the issue. Althouhg i still wonder why KeyDown event isn''t fired (not that i need it anymore, it''s just curiosity).

Administrator [Syncfusion]
Replied On May 23, 2006 10:17 AM UTC

Hi Borja , To get the keydown event of the cell in a grid, you need to handle the CurrentCellKeyDown event. Here is a code snippet. ////Form_ Load Event. this.gridDataBoundGrid1.CurrentCellKeyDown += new System.Windows.Forms.KeyEventHandler(this.gridDataBoundGrid1_CurrentCellKeyDown); private void gridDataBoundGrid1_CurrentCellKeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { MessageBox.Show( e.KeyData +":::" + e.KeyValue +":::" + e.KeyCode,"KeyDownevent event" ); } Here is a sample. http://www.syncfusion.com/Support/user/uploads/DataBoundGrid_3e3da56d.zip Please let me know if you need any further assistance. Best Regards, Haneef


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