Hola sakuragi.
Me he permitido modificar el código que publicó Juan Antonio para adaptarlo a tu pregunta.
Las modificaciones que hice son para consultar el contenido de una columna en específico y pintar el renglón actual dependiendo de una condición.
En este ejemplo consulto el contenido de la columna 3 y si el contenido es par, entonces pinto todo el renglón de azul.
Código Delphi
[-]
procedure TForm1.Button1Click(Sender: TObject);
var
I:Integer;
begin
StringGrid1.RowCount:=6;
StringGrid1.ColCount:=6;
for I:=1 to 5 do
StringGrid1.Cells[3,I]:=IntToStr(I);
StringGrid1.Invalidate;
end;
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
S:String;
Col3: Integer;
begin
Col3:=-1;
S:=(Sender as TStringGrid).Cells[3, ARow];
if S<>'' then Col3:=StrToInt(S);
with Sender as TStringGrid do
begin
if (ACol < FixedCols) or (ARow < FixedRows) then Canvas.Brush.Color := FixedColor
else
if ( Col3 mod 2 =0) then Begin
Canvas.Brush.Color := clBlue;
Canvas.Font.Color := clSilver;
end
else Begin
Canvas.Brush.Color := Color;
Canvas.Font:= Font;
end;
Canvas.FillRect(Rect);
Canvas.TextRect(Rect, Rect.Left+2, Rect.Top+2, (Sender as TStringGrid).Cells[ACol, ARow]);
if gdFocused in State then Canvas.DrawFocusRect(Rect);
end;
end;
Sólo falta adaptarlo para tu caso en particular.
Saludos