[英]Enabling editing for TStringGrid
I am making a simple database application by following this video . 我按照这个视频制作一个简单的数据库应用程序。 My problem occurs when I use a
TStringGrid
instead of a TGrid
as stated the video because I don't have it. 当我使用
TStringGrid
而不是像视频所述的TGrid
时,我的问题就出现了,因为我没有它。 I have a Navigator and all of my data loaded into the TStringGrid
, but I am unable to edit it at all. 我有一个Navigator,我的所有数据都加载到
TStringGrid
,但我根本无法编辑它。 So far I've tried double clicking an entry, pressing F2 and clicking on the Edit button on the Navigator, but nothing is working. 到目前为止,我已经尝试双击一个条目,按F2并单击导航器上的编辑按钮,但没有任何工作。
Is there anything I need to alter in the properties of the TStringGrid
to allow editing or is the purpose of it only to display data? 有什么我需要在
TStringGrid
的属性中改变以允许编辑,或者它的目的只是为了显示数据?
Thank you in advanced! 先谢谢你!
You need to add goEditing
to the Options
property. 您需要将
goEditing
添加到Options
属性。 Include it in the Object Inspector, or in code: 将其包含在Object Inspector中或代码中:
StringGrid1.Options := StringGrid1.Options + [goEditing];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.