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

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
stam
Posts: 3072
Joined: Sun Jun 04, 2006 9:39 pm

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

Post by stam » Sun Oct 11, 2020 4:18 pm

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?
Last edited by stam on Sun Oct 11, 2020 4:39 pm, edited 1 time in total.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » 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!

stam
Posts: 3072
Joined: Sun Jun 04, 2006 9:39 pm

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

Post by stam » Sun Oct 11, 2020 4:38 pm

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

Post Reply