Newbie Data Grid question

Andre.Bisseret Andre.Bisseret at
Mon Dec 14 12:03:47 EST 2009

Bonjour Trevor,

Le 14 déc. 09 à 15:02, Trevor DeVore a écrit :

> On Dec 14, 2009, at 5:11 AM, Andre.Bisseret wrote:
>> Your are right ; I just made a new stack with a data grid "dGrid"  
>> and a field "source"
>> created the columns manually in the inspector (col 1, col 2 etc)
>> In the field, the first tab delimited line includes the names for  
>> the columns.
>> Then
>>  set the pFirstLineContainsHeaders of grp "dGrid" to true -- or,  
>> yes,  put true into pFirstLineContainsHeaders as well
>>  put fld "source" into tData
>>  set the dgText ["pFirstLineContainsHeaders"] of group "Dgrid" to  
>> tData
>> does not work as expected : the columns names keep being "Col 1,  
>> Col 2 etc"
>> and the first line of tData keeps being the first line of Dgrid :-((
> The syntax isn't correct in this example. It should be:
> set the dgText[true] of group "Dgrid" to tData

> I just tested to verify that using the correct syntax does work -  
> and it does :-)
  I just tried this syntax but without success!
set the pFirstLineContainsHeaders of grp "Dgrid" to true
put fld "source" into tData
set the dgText[pFirstLineContainsHeaders] of group "Dgrid" to tData
---- is working
except that I don't get Col 1, Col 2 etc replaced by the first line of  

I get the feeling that I am missing somethins else
In your previous post (answer to Jim) you said :
"The most likely cause is that you don't have a column labeled with  
"Col 1" or "Col 2" in the first line of the data. Therefore the data  
you are setting is not mapping to an existing column in the Data Grid."
Does it mean that the first line of tData should be "Col 1 tab Col 2  
I tried that, and actually, the data grid is filled in but is keeping  
the generic names (Col 1, Col 2 etc)

But then what about this phrase in the doc :
"… by passing in true for pFirstLineContainsHeaders. If true then the
data grid will extract the first line of pText and use the values for  
the internal key/column names …"

I thought it was meaning that In tData I had to put in the first line,  
the names that I would like instead of Col 1, Col 2 etc.

Up to now, I don"t use pFirstLineContainsHeaders ; I set first the  
dgData["columns"] and dgData["column labels"].
But always happy to better understand about Data Grid (here about how  
this pFirstLineContainsHeaders works; seems I am making a bad  
interpretation of the manual.

Thanks Trevor for your always helping advices; I keep appreciating  
Data Grid a lot; in a couple of app. I have several ones which are  
running very nicely  :-))

Best regards from Grenoble


More information about the Use-livecode mailing list