搞定!
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if Dbgrid1.DataSource.DataSet.recno mod 2<>0 then
begin
Dbgrid1.Canvas.Font.Color:=clred;
dbgrid1.DefaultDrawColumnCell(rect,datacol,column,state);
end
else
begin
Dbgrid1.Canvas.Font.Color:=clYellow;
dbgrid1.DefaultDrawColumnCell(rect,datacol,column,state);
endend;
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if Dbgrid1.DataSource.DataSet.recno mod 2<>0 then
begin
Dbgrid1.Canvas.Font.Color:=clred;
dbgrid1.DefaultDrawColumnCell(rect,datacol,column,state);
end
else
begin
Dbgrid1.Canvas.Font.Color:=clYellow;
dbgrid1.DefaultDrawColumnCell(rect,datacol,column,state);
endend;
呵呵,现在的分不好挣啊!