DBGrid with Checkbox lazarus / 16-Databases ---------------------------------------------------------------------- daveinhull · 2019-03-24 12:52 Hi, I've read loads of posts about putting a checkbox in a DBGrid, but I just can't seem to get it to work for me, must be a simple problem, but just can't see it. I have an MS Access database connected to a DBGrid (through the normal means!) and I've got a column attached to a Yes/No field in the DB. I've set the column button style to cbsCheckboxColumn, but all I get in the grid is the string true/false. Do I have to resort to drawing my own checkbox using the DBGrid1DrawColumnCell approach or could there be something simple I've forgotten to do? Thanks in advance Dave ---------------------------------------------------------------------- MichaelBM · 2019-03-24 13:22 In design time: Doubleclick your DBGrid and add all the fields. Select the field you want to be displayed as checkbox. In Properties (Object Inspector)  find - ValueChecked - ValueUnChecked Set the values according to your needs. ---------------------------------------------------------------------- daveinhull · 2019-03-24 13:36 Hi MichaelIBM, Yes that is exactly what I've done, but the DBGrid just shows true/false, not a checkbox. Thanks Dave ---------------------------------------------------------------------- MichaelBM · 2019-03-24 16:04 Did you set the field's property ButtonStyle to "cbsCheckboxColumn" ? ---------------------------------------------------------------------- daveinhull · 2019-03-24 16:20 Yes ---------------------------------------------------------------------- wp · 2019-03-24 16:46 In the attachment I am posting an excerpt of an Access db as used by tvplanit. It displays boolean fields with checkboxes in the dbgrid without doing anything explicitly. Did you create the boolean fields correctly? The demo contains also the code how the fields in the provided mdb file were created. ---------------------------------------------------------------------- daveinhull · 2019-03-24 17:23 Many thanks @wp, Found it and I suspected a simple error. I'd somehow unchecked the dgeCheckboxColumn in OptionsExtra Thanks again Dave