Populating a DataGrid
Posted: Mon Feb 11, 2013 3:02 am
I am trying to learn how scrolling fields, table fields and datagrids work. I have been successful in putting my data into scrolling fields and table fields, but not into a datagrid. I just can't figure out the correct syntax. Can you help. Here is what I am trying. I query a database, and try to put the results into the three types of fields. The first two work, the datagrid doesn't.
Code: Select all
put "....the sql...." into tSQL
-- query the database
put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData
-- check the result and display the data or an error message
if item 1 of tData = "revdberr" then
answer error "There was a problem querying the database:" & cr & tData
else
--Scrolling field works
put tData into field "Data"
--Table field works
put tData into field "TableField1" of card 2
--DataGrid doesn't work. The DataGrid name is "DataGrid1". Currently there is no error message, but nothing is populated. I am trying to follow a sample and I don't know what dgText is.
put true into firstLineContainsColumnNames
set the dgText [firstLineContainsColumnNames ] of group "DataGrid1" of card 3 to tData
end if