//这是Ehlib中的DBGridEh的代码,修改一下就OK了
procedure TDBMDIChildForm.DBGDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
//画斑马线
begin
inherited;
with TDBGridEh(Sender) do
begin
if not Assigned(DataSource) or
not DataSource.DataSet.Active then exit;
if gdSelected in State then
begin
Canvas.Brush.Color := clNavy;
Canvas.Font.Color := clWhite;
end else
if DataSource.DataSet.RecNo mod 2=0 then
Canvas.Brush.Color:= clInfoBk;
DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;