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. Image for the cookie policy date

Getting the Checkbox value

Hi, I have included a "checkBox" column in the GridDataBoundGrid. The grid is displaying the datasource and the column has checkbox. Now my problem is to get the value for the click event of the checkbox column. And how do I know whether the checkbox has been checked or not?(I mean the status of the CheckBox). MS

2 Replies

AD Administrator Syncfusion Team March 24, 2005 04:48 AM

In a CheckBoxClick event, here is code that displays the new value.
private void gridDataBoundGrid1_CheckBoxClick(object sender, Syncfusion.Windows.Forms.Grid.GridCellClickEventArgs e)
{
	bool newValue;
	object oldValue = this.grid[e.RowIndex, e.ColIndex].CellValue;
	if(oldValue == DBNull.Value)
		newValue = true;
	else
		newValue = !(bool)oldValue; //flip the true/false
	Console.WriteLine(newValue);
}


MS Muthu Swamy March 24, 2005 05:35 AM

Clay, working fine. thanks MS. >Hi, > >I have included a "checkBox" column in the GridDataBoundGrid. > >The grid is displaying the datasource and the column has checkbox. > >Now my problem is to get the value for the click event of the checkbox column. > >And how do I know whether the checkbox has been checked or not?(I mean the status of the CheckBox). > >MS

Loader.
Live Chat Icon For mobile
Up arrow icon