Page 1 of 1
Populating Datagrids?
Posted: Mon Nov 23, 2015 5:58 pm
by boogerbrain
I need to get a text file into a datagrid and for it to display the data in three columns: the student name, student gender, and a yes or no. Please help me this is due tomorrow
Re: Populating Datagrids?
Posted: Mon Nov 23, 2015 6:00 pm
by FourthWorld
What does the data look like? If it's tab-delimited you can probably just set the dgText property:
http://lessons.livecode.com/m/datagrid/ ... -with-data
Re: Populating Datagrids?
Posted: Mon Nov 23, 2015 7:08 pm
by dunbarx
Hi.
What Richard said. If it is not tab and return delimited, ask again quickly, since you must format it that way before you can use the one-liner he suggested.
Craig Newman
Re: Populating Datagrids?
Posted: Mon Nov 23, 2015 11:08 pm
by quailcreek
Here's something to help you along. You don't need to set the itemDel unless you're going to refer to the parts of tData as items.
Code: Select all
put fld “FldName” into tData
set the itemDel to tab
put "Name" & tab & “Gender” & tab & “Answer” & cr into TheTextData
set the dgText [true] of grp "YourDataGrid" to TheTextData & tData