HA
haneefm
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 ));
}
}
Best regards,
Haneef
FS
Feng Sha
January 3, 2008 04:06 PM UTC
Good, CurrentCellChanged works.
Thank you,
Frank