procedure TForm22.Button2Click(Sender: TObject);
begin
form22.ClientDataSet1.AppendRecord(['dd','sd',99]);
end;

procedure TForm22.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if ( self.clientdataset1.RecNo mod 2)=0 then begin

dbgrid1.Canvas.Brush.Color :=clBlue;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end
else
begin
dbgrid1.Canvas.Brush.Color :=clred;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);


end;

end;