procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
Grid:TDBGrid;
R:TRect;
begin
Grid:=TDbGrid(Sender);
r.left:=Rect.left-1;
r.Top:=Rect.Top-1;
r.right:=Rect.right+1;
r.bottom:=Rect.bottom+1;
with Grid do
begin
if (datasource.DataSet.RecNo Mod 2)=0
then
canvas.Brush.color:=clYellow
else
canvas.Brush.color:=$00ff00;
Font.color:=clRed;
canvas.Rectangle(r);
canvas.TextOut(rect.left,rect.top,column.Field.AsString );
end;
end;