Define Datagrid Form Columns
Posted: Tue Nov 08, 2016 6:49 pm
Hi, hope someone can help me on this please.
I can't see how the columns used in a Datagrid Form are defined. In the tutorial "Creating a list of people" the datagrid behaviour script FillInData uses values from columns pDataArray["LastName"], pDataArray["FirstName"], pDataArray["Title"] and pDataArray["Image URL"], which works fine when I follow the exercise.
e.g.
set the text of field "Name" of me to pDataArray["LastName"] & comma & space & pDataArray["FirstName"]
set the text of field "Title" of me to pDataArray["Title"]
set the filename of image "image" of me to pDataArray["Image URL"]
But if I create a new Datagrid Form the columns seem to be setup automatically as "label 1", "label 2", "label 3"which I found just by guessing!
i.e. this code in a new Datagrid Form behaviour script works fine:
set the text of field "Width" of me to pDataArray["label 1"]
set the text of field "Height" of me to pDataArray["label 2"]
set the text of field "Name" of me to pDataArray["label 3"]
But where does label 1 etc come from? In a data grid table then they are setup in the properties but when you choose a Datagrid Form the columns tab disappears. I haven't setup label 2 or label 3, are they the defaults in the pDataArray variable?
Any help or suggestions gratefully received on to how to specify the column headers in a Datagrid Form?
Roger
I can't see how the columns used in a Datagrid Form are defined. In the tutorial "Creating a list of people" the datagrid behaviour script FillInData uses values from columns pDataArray["LastName"], pDataArray["FirstName"], pDataArray["Title"] and pDataArray["Image URL"], which works fine when I follow the exercise.
e.g.
set the text of field "Name" of me to pDataArray["LastName"] & comma & space & pDataArray["FirstName"]
set the text of field "Title" of me to pDataArray["Title"]
set the filename of image "image" of me to pDataArray["Image URL"]
But if I create a new Datagrid Form the columns seem to be setup automatically as "label 1", "label 2", "label 3"which I found just by guessing!
i.e. this code in a new Datagrid Form behaviour script works fine:
set the text of field "Width" of me to pDataArray["label 1"]
set the text of field "Height" of me to pDataArray["label 2"]
set the text of field "Name" of me to pDataArray["label 3"]
But where does label 1 etc come from? In a data grid table then they are setup in the properties but when you choose a Datagrid Form the columns tab disappears. I haven't setup label 2 or label 3, are they the defaults in the pDataArray variable?
Any help or suggestions gratefully received on to how to specify the column headers in a Datagrid Form?
Roger