I have a datagrid with 33 columns where the even numbered rows contain basically just text while the odd rows contain mostly 'numeric' values even though the column itself is set for text format. Under certain conditions I want the 'numeric' text to show up red while all the other text is black. I am using the FillnData routine that is in my button called My Default Column Behavior to accomplish this. Here is partial code for that button:
Code: Select all
-- This message is sent when the Data Grid needs to populate
-- this template with the column data. pData is the value to be displayed.
--set the text of the long ID of me to pData ## temp workaround for
global gLiquidity
put the dgColumn of me into tCol
If tCol="Pick30" then
beep
end if
if offset("Pick",tCol)>0 then
put "Pick" into tCol
end if
switch tCol
case "Pick"
if isNumber(pData) then
set the numberFormat to "#.0000"
put pData*1 into pData
if pData > gLiquidity then
set the foreGroundColor of me to "red"
end if
end if
break
case "Average"
set the numberFormat to "#.0000"
put pData*1 into pData
if pData > gLiquidity then
set the foreGroundColor of me to "red"
end if
break
end switch
set the text of the long ID of me to pData ## temp workaround for
end FillInData
Is there some datagrid setting I am missing? Why is it changing back. The other situations where I have used FillnData to change the color of the text have not involved a global variable nor the alternating rows.
Thanks for any light you can shed on this,
Larry