TDBGrid 隔行颜色
with(Sender as TDBGrid) do
begin
if ((State=[gdSelected])or (State= [gdSelected, gdFocused])) then
begin
Canvas.Font.Color:=clHighlightText;
Canvas.Brush.Color:=clHighlight;
end
else
begin
if DataSource.DataSet.RecNo mod 10 =0 then
Canvas.brush.Color:=clRed ;
//else
// Canvas.brush.Color:=clYellow;
end;
DefaultDrawColumnCell(Rect,DataCol,Column,State); //这行是关键
end;