data grid code (color)

Sadhu Nadesan sadhu at
Thu Apr 16 21:05:05 EDT 2009

(2nd try - yet another post that never made it the first time - sent with Mush, an old Unix text email program, no HTML as far as I know, trying again with Thunderbird choosing send in text only, fingers crossed)

Hi Trevor,

More info:

I am using the default template and not overriding the default column
behavior, and I am not using a custom column template as far as I know.

All I am doing is using a default data grid (with 9 columns, the only
thing I set was the column labels) and filling in the data in one gulp by
setting the dgtext of the group, and then, scanning through the data line
by line, and cell by cell to see if that cell holds a valid value, then
setting it to different text (such as 'not found') if it is not valid.

The repeat loop was the part doing the scan.

Are you saying, I either need to override the default behavior with a
script, or, create a customized column template?  I don't want every
cell red in every column, just selected cells in selected columns.
Is that possible?

If I need to refer to the lessons on creating override behavior I can
do that next.

Sorry to be  so dense.  I was hoping there was maybe something simple
like setting the color properties of a container variable with text
in it and then putting it into a specific cell of the data grid with
SetDataOfIndex or something like that.

Not so simple I guess?

Thank you again,


> > If you are using the default template and overriding the 'default  
> > column behavior' with your own script then your column consists of a  
> > single field. In your FillInData handler for the column you could try  
> > setting the backgroundColor of me to "red" and the opaque to true. If  
> > there isn't an error than set the opaque to false.
> > 
> > If you customized the column template using the Property Inspector  
> > then your column consists of a group with a single field in it. In  
> > this case just target 'field 1 of me' rather than 'me'.

More information about the use-livecode mailing list