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.

KeyDown event doesn`t get fired at GDBG

Thread ID:

Created:

Updated:

Platform:

Replies:

44394 May 23,2006 05:06 AM May 23,2006 06:17 AM Windows Forms 3
loading
Tags: GridControl
Borja
Asked On May 23, 2006 05:06 AM

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 05:23 AM

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

Borja
Replied On May 23, 2006 05:55 AM

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 06:17 AM

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

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.

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.

;