procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
Value: integer;
begin
if gdSelected in State then Exit;
Value := DBGrid1.DataSource.DataSet.FieldByName('Code').AsInteger;
if MyValue < 100 then
DBGrid1.Canvas.Brush.Color := clYellow
else
if Value < 200 then
DBGrid1.Canvas.Brush.Color := clGreen
else if MyValue < 300 then
DBGrid1.Canvas.Brush.Color := clRed;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;