TTeeGrid在运行时未使用REST中的数据显示数据 [英] TTeeGrid is not displaying the data at runtime using data from REST

查看:59
本文介绍了TTeeGrid在运行时未使用REST中的数据显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为TTeeGrid创建了一个简单的RME,TTeeGrid是Firemonkey中TGrid的后代.如下所示,数据是在设计时显示的,但标题除外.在运行时不显示.

I created a simple RME for TTeeGrid, a descendant perhaps of TGrid in Firemonkey. As shown below, the data are displayed at design time but not at runtime except the headers.

我已经为此挣扎了好几个星期,但还没有走运.

I've been breaking my head over this for weeks already but not luck.

让我知道是否需要更多详细信息,但您在图像中看到的就是全部.

Let me know if you need more details but what you see in the image are all you get.

我只需要帮助就可以在运行时显示数据,如设计时所示.

I just need help to have the data displayed at runtime as shown in the design time.

更新1

使用TPrototypeBindSource不会出现此问题.设计时显示的数据在运行时显示.某处出了点问题.

This issue is not the case with TPrototypeBindSource. The data shown in the design time are displayed at runtime. Something is wrong somewhere.

推荐答案

我以前从未使用过TeeGrid,但是以下方法工作正常第一次在东京德尔斐(Delphi Tokyo):

I've never used the TeeGrid before, but the following worked fine first time for me in Delphi Tokyo:

  1. 从Steema.Com&中下载TeeGrid试用版.安装.

  1. Download the TeeGrid trial from Steema.Com & install.

创建新的多设备应用并将TeeGrid和FDMemTable放置在表单上.

Create new multi-device app and place a TeeGrid and a FDMemTable on the form.

从Delphi样本数据目录中将Part.Fds文件加载到FDMemTable1中.请注意,我之前并未创建任何FieldDefs,正如我在前面的评论中提到的那样,因为我所描述的内容在没有它们的情况下是有效的.

Load FDMemTable1 with the file Parts.Fds from the Delphi samples Data directory. Note, I did not then create any FieldDefs as I mentioned in my comment earlier as what I'm describing works without them.

将TeeGrid1的DataSource属性设置为FDMemTable1.TeeGrid1立即为每个零件"字段创建列,并用数据填充它们-请参见下面的屏幕截图.我通常不包括屏幕截图,但在这种情况下,我认为我想我所得到的显然与您所报告的相矛盾.

Set the DataSource property of TeeGrid1 to FDMemTable1. TeeGrid1 immediately creates columns for each of the Parts fields and populates them with data - see screenshot below. I don't ordinarily include screenshots but in this case thought I would as what I got was so clearly at odds with what you've reported.

您的TeeGrid等显然比我的复杂.所以我会尽力建议您回溯到步骤2,看看是否可以复制我的结果与您的数据(在设计时或运行时)一起使用.可能值得加载您的FDMemTable在设计时带有一些数据,因为我的印象是实时绑定当数据源中包含一些数据时,这种情况不太容易发生.

Your TeeGrid etc are obviously more complicated than mine. so the best I can suggest is that you backtrack to step 2 and see if you can replicate my result with your data (either at design time or run time). It might be worth loading your FDMemTable with some data at design time, as my impression is that live bindings is less grief-prone when the datasource has some data.

顺便说一句,我尝试使用常规TGrid建立实时绑定的结果是非常不完整的,直到我发现与其自己搞乱LB组件,不如直接从一个新的TGrid开始,右键单击在它上面,并离开实时绑定向导始终如一地正常工作.

Incidentally, fwiw the results of my own attempts to set up live bindings even with a regular TGrid have been rather patchy, until I discovered that instead of messing with the LB components myself, simply starting with a fresh TGrid, right-clicking on it and leaving the Live Bindings Wizard to do its stuff consistently works fine.

这篇关于TTeeGrid在运行时未使用REST中的数据显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆