Putting Records Into a Data grid?

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
Mr LiveCode man
Posts: 4
Joined: Mon Dec 12, 2011 1:29 pm

Putting Records Into a Data grid?

Post by Mr LiveCode man » Mon Dec 12, 2011 1:35 pm

Hey guys, I've been able to put normal text and pictures into a data grid, but i need to put a record in with out having to manually put all the data in, does anyone know what i have to do to do this?

Any help would be appreciated

cheeeeers

P.S I'm using livecode 4.6.0

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Putting Records Into a Data grid?

Post by bangkok » Mon Dec 12, 2011 5:35 pm

What do you mean by "record" ?

Data coming from a database for instance ?

If yes, nothing special or different from regular text.

Code: Select all

      put false into pFirstLineContainsHeaders 
      set the dgText [ pFirstLineContainsHeaders  ] of group "myDataGrid" to myData

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: Putting Records Into a Data grid?

Post by marksmithhfx » Tue Dec 13, 2011 5:10 am

bangkok wrote:What do you mean by "record" ?

Data coming from a database for instance ?

If yes, nothing special or different from regular text.

Code: Select all

      put false into pFirstLineContainsHeaders 
      set the dgText [ pFirstLineContainsHeaders  ] of group "myDataGrid" to myData

Bangkok, you may know this already but the above can be abbreviated to

Code: Select all

 set the dgText of group "myDataGrid" to myData
This will work fine as long as you are using the default (false) setting for dgText.

-- Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Mr LiveCode man
Posts: 4
Joined: Mon Dec 12, 2011 1:29 pm

Re: Putting Records Into a Data grid?

Post by Mr LiveCode man » Tue Dec 13, 2011 10:49 am

Thanks for that, i shall see if it works :) By record i mean a 2-D array with different data types.

Cheeeers.

EDIT : I think that would work but I'm having trouble putting any data into the data grid. Is there something i need to do , to get the data grid to update with the new data?

Post Reply