Page 1 of 1

[SOLVED] Data grid help - data only populating 1st row

Posted: Sun Oct 11, 2020 4:18 pm
by stam
Hi all,
i'm sure this is something i'm not doing right, but can't seem to get past this...

I have data grid as a form. I generate a numerically based array and set the dgData to this. I can confirm the array is correct when inspecting the dgCache of the data grid. To help design the form, i put some boilerplate text in the labels which is mean to be replaced by the dgData fields.

There are a couple of labels that are meant to take data from the dgData array to display.
For both of these, in the fillInData handler, i have the the following code:

Code: Select all

set the text of field "field1" of me to pDataArray["field1"]
set the text of field "field2" to pDataArray["field2"]
the weird thing is, that 'field1' populates all rows correctly.

But 'field2' only populates the 1st row (correctly), the rest are the boilerplate text i added in design.

Racking my brain -- any suggestions?

Re: Data grid help - data only populating 1st row

Posted: Sun Oct 11, 2020 4:36 pm
by Klaus
You forgot ... OF ME in the second line! :-)

In that case LC will only populate the very FIRST field on the card with that name and overwrite this in every loop!

Re: Data grid help - data only populating 1st row

Posted: Sun Oct 11, 2020 4:38 pm
by stam
Klaus wrote:
Sun Oct 11, 2020 4:36 pm
You forgot ... OF ME in the second line! :-)

In that case LC will only populate the very FIRST field on the card with that name and overwrite this in every loop!
Ugh! I'm an idiot and you're a genius lol.... that worked, thank you :D