简体   繁体   English

Delphi-如何获取cxGrid列的图像?

[英]Delphi - How to get a image for a cxGrid column?

I have a TcxGrid component to show data of a MS Access table. 我有一个TcxGrid组件来显示MS Access表的数据。 One of this columns have a picture. 其中一列具有图片。 The column "Properties" of this column is marked as "ButtonEdit". 该列的“属性”列标记为“ ButtonEdit”。

I don't want to use a BlobEdit. 我不想使用BlobEdit。 I want to create another form, for display this picture. 我想创建另一个表格来显示这张图片。 It will be opened by OnButtonClick() event of the grid column. 它将通过网格列的OnButtonClick()事件打开。 But, I don't know how to get the column content (as TStream or other type), or the column name/field name in the OnButtonClick() event. 但是,我不知道如何获取列内容(作为TStream或其他类型),或者如何获取OnButtonClick()事件中的列名称/字段名称。 I can't fix the column name, because it's a "generic" grid for show any Access table. 我无法固定列名,因为它是用于显示任何Access表的“通用”网格。

How can I do it? 我该怎么做?

It will be nice to understand your question better if you can post your code. 如果您可以发布代码,那么更好地理解您的问题将非常高兴。 But offcourse You can get column contents easily by using FieldByName method. 但是,当然,您可以使用FieldByName方法轻松获取列内容。 Try to use that. 尝试使用它。

您没有说如何将数据加载到网格中,但是要获取单元格内容,可以使用:

  VarAsType(cxGrid1TableView1.DataController.Values[cxGrid1TableView1.Controller.FocusedRecordIndex,cxGrid1TableView1.Controller.FocusedColumnIndex],varString)

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

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