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.
Is there a way to handle the CheckChanged event of a Checkbox cell? I can''t seem to find any event that will let me do this. Even the CellClick event doesn''t appear to fire when I click on a Checkbox type cell.
ADAdministrator 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.
MSMaxim Software SystemsFebruary 24, 2006 02:33 PM UTC
I can''t believe I didn''t see the CheckBoxClick event.
MSMaxim Software SystemsFebruary 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.