Hi, I know that this is a very old post but it is probably worth adding that the example above uses a "custom column behavior script" which works with a single column. If you want the colours to be applied across all the columns then the same code should be used in a behavior button that is set as the "default column behavior". This is set using commands like:
Code: Select all
Set the dgProps["default column behavior"] of group "DgLCSS" to the SelObj()
(see page 126 of the datagrid guide).
It is also worth noting that it is possible to set the colour of the text in FillInData but that it gets reset when "setprop dgHilite pBoolean" is called. Despite what is written in the comments :
Code: Select all
setprop dgHilite pBoolean
-- This custom property is set when the highlight of your column template has
-- changed. You only add script here if you want to customize the highlight.
if pBoolean then
set the foregroundColor of me to the dgProp["hilited text color"] of the dgControl of me
else
set the foregroundColor of me to empty
end if
end dgHilite
This is called after every row has been populated which means that the colour you set is very short lived.