给你个EX.
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
inherited;
With DbGrid1 do
begin
if ((State = [gdSelected]) or (State = [gdSelected,gdFocused])) then
begin
Canvas.Font.Color := clYellow;
Canvas.Brush.Color := clNavy;
end
else
begin
if Table2.RecNo mod 2 <> 0 then Canvas.Brush.Color := clWhite
else Canvas.Brush.Color := $00EAEAEA;
end;
DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;
end;