I would add another, invisible column to your dgData array, let's call it "textStyle", and differentiate the column behavior on the basis of that entry.
Here's how I made a quick test stack for myself:
- create a new stack
- drop a datagrid onto it
- give it 4 columns
- for the first column, add a column template
- leave the template as is, but change its column behavior script, updating the FillInData handler to:
Code: Select all
on FillInData pData
local tDataGrid, tIndex, tDataOfLine, tTextStyle
put the dgControl of me into tDataGrid
put the dgIndex of me into tIndex
put the dgDataOfLine[tIndex] of tDataGrid into tDataOfLine
put tDataOfLine["textStyle"] into tTextStyle
set the textStyle of field 1 of me to tTextStyle
set the text of field 1 of me to pData
end FillInData
- use the Content panel of the Inspector palette to quickly add a few lines to the datagrid
- drop a button next to your datagrid, and set its script to:
Code: Select all
on mouseUp
local tDataOfLine
put the dgDataOfLine[1] of group "Datagrid 1" into tDataOfLine
put "bold" into tDataOfLine["textStyle"]
set the dgDataOfLine[1] of group "Datagrid 1" to tDataOfLine
end mouseUp
- click the button, and 'lo and behold, the first column of the first row is now in bold
- as a bonus, you can use any valid combination of text styles, such as "bold,italic" and they will all be applied
Applying this textstyle-driven behavior script to each column, should do the trick.
HTH,
Jan Schenkel.