Force boolean datatype datagridview

Answered
0
0

Howdy,

I can i force datagridview, to show the checkbox for the boolean field true/false?
I’m trying:

grid.Columns(“p1”).ValueType = GetType(Boolean)

But nothing.

The field in MySQL is a enum() with true or false.

  • You must to post comments
Best Answer
0
0

Hi Jorge
From your question I understood that you have a value that is not boolean, but you want to checkbox will show it checked and unchecked.
Independent from the database, it’s the datatable or object structure that you populate from database the important stuff.
In the sample proyect, I populate a datatable with diferente logical values in diferent datatpyes and used it how datasource for a datagrid with checkbox.
The checkbox take the int and string values how logical and show how checked and unchecked

Datagrid above with custom columns and ckeckbox columns linked with
Datagrid below without columns,
01-datagrid

Code for populate DataTabe
02-code

I hope helped you
Regards
Paul

  • You must to post comments
0
0

Hi Paul,

Thanks, very helpful!

  • Paul (ITG)
    To help you. I would appreciate if you can accept my answer and rate it, with the green button. Regards
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.