Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
What was working in 2017.2 no longer works in 2022.2 WebDataGrid setting Unbound Checkbox value (specified cast not valid)
posted

Recently updated my project with v2022.2 from v2017.2 components.  In the past, no issues, simple upgrade and publish.  However, something changed and I can't seem to put my finger on it.  It may just be staring me in the face. 

To isolate if it's something in the old page/code, I created a single page with a WebDataGrid with a single UnboundCheckbox.  I run a query, bind it then set the value of the checkbox.  I use session variables (a lot).  So, immediately AFTER issuing a .DataBind I execute this line:

Me.wgTestCheckBox.Rows(0).Items(0).Value = CBool(Session("Grant_Svc"))

In the past, it worked fine.  Now it throws an "Invalid Cast" error.  Keep in mind the value being assigned to the checkbox is boolean.  I've gone back and forth with this, modifying the view to convert the source text column to boolean, no success, So I revert the value in the database view back to text and doing as above (which currently works in the old project).

Regardless, of how I approach it, I continue to get "Invalid Cast" error.  WHAT AM I NOT SEEING, or did something change with UnboundCheckBoxes since 2017.2?

Parents Reply Children
No Data