CheckBoxClick event

Hey,

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?

Thanks,

Frank


2 Replies

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



Loader.
Up arrow icon