procedure TForm1.DBGrdTypeDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
inherited;
with DBGrid1 do
begin
if State <> [gdSelected, gdFocused] then
begin
if xxxx then
Canvas.Font.Color := clBlue
else
Canvas.Font.Color := clRed
end;
DefaultDrawColumnCell(Rect, DataCol, Column, State); //这行是关键
end;
end;