Search code examples
restdelphifiremonkeytgridfdmemtable

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


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.

enter image description here

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.


Solution

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

    enter image description here