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
close icon

GridControl using UncheckedValue CheckBox cell

I am running into a problem with a GridControl I am using. On load, I set the CheckedValue to be some string and the UncheckedValue to be the empty string (string.Empty). If I don''t do anything, the cellValue will be the empty string. However, if I check it, and then uncheck it, the cellValue is changed to "0". Is there a reason why this is happening, and a way i can prevent this? Thanks, Michael Sabin

2 Replies

AD Administrator Syncfusion Team January 20, 2005 09:00 PM UTC

The grid switches an empty falsevalue string to "0". This is by design. You can see this at \Syncfusion\Essential Suite\3.0.1.0\Windows\Grid.Windows\Src\Extensions\CellTypes\GridCheckBoxCellModel.cs(91) if you have teh source code. If you do not want this, then one way to work around it is to handle the SaveCellInfo event and swap the value there.
private void gridControl1_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e)
{
	if(e.Style.CellType == "CheckBox" && e.Style.Text == "0")
		e.Style.Text = "";
}


AD Administrator Syncfusion Team January 21, 2005 10:51 AM UTC

That works... Thanks

Loader.
Live Chat Icon For mobile
Up arrow icon