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.
I'm using Syncfusion 4.3.0.30 windows.forms Grid Control in virtual mode.
I want to suppress certain key events triggered by the user (e.g. CTRL + X, CTRL + V, CTRL + Z, DELETE, etc.) if the grid isn't in editing state or the selected cell is readonly or static. Suggestions?
ADAdministrator Syncfusion Team November 8, 2007 05:51 PM UTC
I think you can use grid.CurrentCellKeyDown to get this behavior. Here is the idea. //subcribe to the event this.gridControl1.CurrentCellKeyDown += new KeyEventHandler(gridControl1_CurrentCellKeyDown);
//the handler code void gridControl1_CurrentCellKeyDown(object sender, KeyEventArgs e) { GridControl grid = sender as GridControl; if (grid != null && !grid.CurrentCell.IsEditing) { if (e.Control) { switch (e.KeyCode) { case Keys.V: case Keys.C: case Keys.X: e.Handled = true; break; default: break; } } else if (e.KeyCode == Keys.Delete) { e.Handled = true; } } }