Assuming you have a [tt]TTable[/tt] or [tt]TQuery[/tt] etc, you can use a [tt]tDBCtrlGrid[/tt], and attach your datasource.
Set up the number of rows, and drag a [tt]tDBCheckBox[/tt], and any other fields you need onto the top row.
In the properties of your [tt]tDBCheckBox[/tt] set the field property to your field. You can change the caption to reflect your data of course.
In the [tt]ValueChecked[/tt] and [tt]ValueUnchecked[/tt] properties set the values to 0 and 1 (as per your description above)
I always reckon that the inability of TDBGrid to display a checkbox is a shortcoming of Delphi.
Chris has one solution. If you don't want to use a TDBCtrlGrid, you can paint a checkbox onto a TDBGrid using OnDrawColumn cell and then trap OnClick to handle the changing. More than trivial, but certainly doable.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.