AD
Administrator
Syncfusion Team
February 24, 2006 04:55 AM UTC
Hi Don,
The CheckBoxClick, CurrentCellChanged and CellsChanged are events that get triggered when there is change in the check box. The CheckBoxClick event will get fired only when the checkbox is clicked. The other two events will get fired, when there is change of any type in the cells .
// On Mouse Click on CheckBox only
private void gridControl1_CheckBoxClick(object sender, Syncfusion.Windows.Forms.Grid.GridCellClickEventArgs e)
{
Console.WriteLine("CheckBoxClick");
}
// Change in CurrentCell ( Check / UnCheck )
private void gridControl1_CurrentCellChanged(object sender, System.EventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
if(cc.Renderer.StyleInfo.CellType == "CheckBox")
Console.WriteLine(this.gridControl1[cc.RowIndex, cc.ColIndex].Text);
}
// Change in a cell / group of cells ( Check / UnCheck )
private void gridControl1_CellsChanged(object sender, Syncfusion.Windows.Forms.Grid.GridCellsChangedEventArgs e)
{
Console.WriteLine("CellsChanged");
}
Best Regards,
Madhan.
MS
Maxim Software Systems
February 24, 2006 02:33 PM UTC
I can''t believe I didn''t see the CheckBoxClick event.
MS
Maxim Software Systems
February 24, 2006 03:10 PM UTC
Just a side note here:
The CurrentCellChanging event only fires on the first click on not on any subsequent clicks (as long as the cell remains the current cell), which could let the user easily bypass any restrictions.
On the other hand, the CurrentCellChanged event fires reliably enough, but it doesn''t allow for the click operation to be cancelled.
The CheckBoxClick event fires before the grid''s CurrentCell property is updated, so you must access the grid cell''s value directly, meaning you''ll be dealing with the opposite value that the cell''s checkbox was changed to.
Just FYI for future readers who come across this issue.