简体   繁体   English

在 stringgrid Delphi FMX 中添加复选框

[英]Add checkbox in stringgrid Delphi FMX

for an app, I have a stringgrid with objects.对于一个应用程序,我有一个带有对象的字符串网格。 now it is the intention that the objects are selected in the string grid by means of the checkbox.现在打算通过复选框在字符串网格中选择对象。 so for every row, there must be a column with a checkbox.因此,对于每一行,都必须有一列带有复选框。 what is the best way for this on an FMX platform?在 FMX 平台上最好的方法是什么? Or is there a way you can add a column in the SQL database with checkboxes?或者有没有办法可以在 SQL 数据库中添加一个带有复选框的列?

I solved the problem and did it like this.我解决了这个问题并这样做了。 First, I added a column in SQL with a bit value.首先,我在 SQL 中添加了一个带有位值的列。 In Delphi a linked it to a memtable with the boolean value.在 Delphi 中,将其链接到具有 boolean 值的内存表。 Now I bind the string grid visually to the memtable so the string grid filled with the SQL data.现在我将字符串网格直观地绑定到 memtable,以便字符串网格填充 SQL 数据。 when you right-click on string grid you see 'columns editor..' click on that and you see the columns from the SQL.当您右键单击字符串网格时,您会看到“列编辑器..”单击它,您会看到 SQL 中的列。 now click on the boolean column and change the column type to Tcheckcolumn.现在单击 boolean 列并将列类型更改为 Tcheckcolumn。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM