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

CheckBox cell throwing (handled) exceptions

Thread ID:





15145 Jun 11,2004 01:48 PM UTC Jun 11,2004 03:39 PM UTC WinForms 3
Tags: GridControl
Lee Perkins
Asked On June 11, 2004 01:48 PM UTC

I have an custom IncomeCollection collection class bound to a GDBG. IncomeCollection holds Income objects. The Income class has a public PrimaryFlag property of type Boolean. A column in the GDBG is bound to the PrimaryFlag property, and it''s GridBoundColumn.StyleInfo.CellType is set to "CheckBox". When I check/uncheck a checkbox in the PrimaryFlag column, there are 3 ''System.ArgumentException'' exceptions thrown with additional information of ''Cannot widen from target type to primitive type.''. The first 2 are in system.dll, the last one is in syncfusion.grid.dll. They are handled inside the grid control, (I just get the first-chance exceptions), but is this normal, or am I doing something wrong? ----- Lee Perkins

Lee Perkins
Replied On June 11, 2004 02:02 PM UTC

Update to my previous post: If I ignore First-Chance exceptions, there is a runtime effect to these exceptions. Once I check one of the checkboxes in the PrimaryFlag column, if I try to click off the checkbox cell to cell in another row, I get a msgbox that says "Cannot widen from target type to primitive type." and it won''t let me off the cell. If I try to click off the checkbox cell to another cell in the same row, it lets me. If I then try to click on any cell in another row, I get a msgbox that says "Object type cannot be converted to target type." These msgboxes aren''t exceptions, they seem to be coming from the grid control. If I use the keyboard and hit the SpaceBar while in the checkbox cell, I actually get the "Cannot widen from target type to primitive type." exception bubbled up to me, unhandled. ----- Lee Perkins

Administrator [Syncfusion]
Replied On June 11, 2004 02:42 PM UTC

Also try setting the GridBoundColumn.StyleInfo.CellValueType to GetType(Boolean). Also set GridBoundColumn1.StyleInfo.CheckBoxOptions = CheckBoxOptions = New GridCheckBoxCellInfo(Boolean.TrueString, Boolean.FalseString, "", False)

Lee Perkins
Replied On June 11, 2004 03:39 PM UTC

Thanks for the suggestion. I think I found the problem though. The PrimaryFlag property was (for some UNKNOWN and UNNOTICED reason!) was Integer, not Boolean. Haven''t had a chance to test it again since I changed it to Boolean, but will test it Monday morning. :) ----- Lee Perkins


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