The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team 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
BOBorjaMay 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).
ADAdministrator Syncfusion Team 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