Checkbox and MySQL

Hi,

As you are aware, MySQL does not accept BOOLEAN as a type and uses TINYTXT(1) instead. I made sure it is either 0 or 1.
I am trying to make a simple CRUD page with one of the fields being a checkbox.

In the datagrid, I have the checkbox in a template. It shows up plain blue. In the Add and Edit pages, same thing and they are not actionable.

I tried to add TValue as attribute with bool as corresponding value but get a

Cannot implicitly convert type 'int?' to 'bool' and "Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type"

I understand why I get this message but not what I miss to get it fixed.

Thank you

Fred

There is no such data type in MySQL - you are most probably referring to tinyint(1) and Radzen will map this type to bool by default:







of course TinyInt sorry

I think I am doing the very same thing:

but it shows up differently in the datagrid:


update: I just noticed that in my steps.cs file, TurningPoint shows up as int?
image

Check if the field is tinyint(1) not just tinyint.

That works.

For future reference, problem might be related to MySQLWorkbench.
Here is what is happening: if you define the datatype as BOOLEAN, MySQLWorkbench automatically changes it to TINYINT which causes the problem described above. But defining it as TINYINT(1) directly brings the expected result.

Thank you Enchev