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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridControl using UncheckedValue CheckBox cell

Thread ID:





23845 Jan 20,2005 07:32 PM UTC Jan 21,2005 10:51 AM UTC WinForms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On January 20, 2005 07:32 PM UTC

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

Administrator [Syncfusion]
Replied On 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\\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 = "";

Administrator [Syncfusion]
Replied On January 21, 2005 10:51 AM UTC

That works... Thanks


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon