TTeeGrid is not displaying the data at runtime using data from REST

给你一囗甜甜゛ 提交于 2021-01-28 22:23:50

问题


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.

UPDATE 1

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


回答1:


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

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

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

  3. 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.

  4. 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.

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.

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.



来源:https://stackoverflow.com/questions/62925436/tteegrid-is-not-displaying-the-data-at-runtime-using-data-from-rest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!