We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

CheckBoxClick event

Thread ID:

Created:

Updated:

Platform:

Replies:

70810 Jan 2,2008 01:47 PM Jan 3,2008 11:06 AM Windows Forms 2
loading
Tags: GridControl
Feng Sha
Asked On January 2, 2008 01:47 PM

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


haneefm [Syncfusion]
Replied On January 2, 2008 03:32 PM

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


Feng Sha
Replied On January 3, 2008 11:06 AM

Good, CurrentCellChanged works.
Thank you,
Frank



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;