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 handling the CheckBoxClick event for a checkbox cell on a gridControl. But if I make the checkbox cell the current cell and press the spacebar, the checkbox will be selected/deseleted as well. However, the CheckBoxClick doesn't get raised in this case.
Basically, I need to raise and event whenever the checkbox in the cell is selected/deselected. Can you please?
HAhaneefm Syncfusion Team January 2, 2008 08:32 PM UTC
Hi Frank,
You need to handle the CurrentCellChanged event to check for the current cell state/value change for the CheckBox cell.
//Or
You can catch Space key at CurrentCellKeyPress handler of the grid and raise the checkbox click by using the RaiseCheckBoxClick method. Below are the codes:
void gridControl1_CurrentCellKeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == ' ') { GridControl grid = sender as GridControl; GridCurrentCell cc = grid.CurrentCell; Point ptCellLocation = cc.Renderer.GetCellBoundsCore(cc.RowIndex,cc.ColIndex).Location; ptCellLocation.Offset( 1,1); grid.RaiseCheckBoxClick(cc.RowIndex, cc.ColIndex, new MouseEventArgs(MouseButtons.Left, 1, ptCellLocation.X,ptCellLocation.Y,1 ));