Here's some working code from a program of mine which does something similar.
procedure TDoDockets.grDocketsDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
with grDockets do
begin
if (qDocketsOpenCost.asinteger > 1) and (datacol = 5)
then canvas.font.color:= clRed;
if datacol = 9 then // status
if qDocketsColour.Value <> 0
then Canvas.font.color:= tcolor (qDocketsColour.Value);
if datacol = 10 then // attention
if qDocketsAttention.asinteger = 1
then canvas.brush.color:= clRed;
if qDocketsUrgent.asinteger = 1 then canvas.brush.color:= 10092543;
// light yellow
DefaultDrawColumnCell (Rect, DataCol, Column, State);
end
end;
grDockets is the grid, and qDockets is the query being displayed within the grid. Certain columns may be drawn in a different colour depending on the value being displayed, and in one case (qDocketsUrgent = 1), the entire line's background colour is changed.