Detecting columns checked in a grid

I have a column of checkbox''s in my grid. I need to have an event when anyone one of these checkbox''s changes state. How would you suggest I do this? Cheers Steve

4 Replies

AD Administrator Syncfusion Team December 18, 2004 09:07 AM UTC

Have you tried the grid.CheckBoxClicked event?


SH Steven Hawkes December 18, 2004 01:01 PM UTC

>Have you tried the grid.CheckBoxClicked event? Thanks for the quick response Yes, I tried this one and it does work but unfortunately it is fired before the state of the button is changed. I wa actually looking for a post event.


AD Administrator Syncfusion Team December 18, 2004 01:32 PM UTC

If the change is coming from your user, you can use CurrentCellChanged.
private void gridDataBoundGrid1_CurrentCellChanged(object sender, EventArgs e)
{
	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
	GridStyleInfo style = this.gridDataBoundGrid1[cc.RowIndex, cc.ColIndex];
	if(style.CellType == "CheckBox")
	{
		Console.WriteLine(style.CellValue);
	}
}
If you want to catch changes to your datasource from outside the grid, then you can try some event on your datasource, maybe DataTable.COlumnChanged.


SH Steven Hawkes December 19, 2004 04:09 AM UTC

Thanks for your help, works great. >If the change is coming from your user, you can use CurrentCellChanged. >
>private void gridDataBoundGrid1_CurrentCellChanged(object sender, EventArgs e)
>{
>	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
>	GridStyleInfo style = this.gridDataBoundGrid1[cc.RowIndex, cc.ColIndex];
>	if(style.CellType == "CheckBox")
>	{
>		Console.WriteLine(style.CellValue);
>	}
>}
>
> >If you want to catch changes to your datasource from outside the grid, then you can try some event on your datasource, maybe DataTable.COlumnChanged.

Loader.
Up arrow icon