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

GridControl using UncheckedValue CheckBox cell

Thread ID:

Created:

Updated:

Platform:

Replies:

23845 Jan 20,2005 02:32 PM Jan 21,2005 05:51 AM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 20, 2005 02:32 PM

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 04:00 PM

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 = "";
}

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

That works... Thanks

CONFIRMATION

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.

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.

;