在dbgrid的ondrawcolumncell事件中填写
if table1.Fieldbyname('size').asfloat>=30 then
   dbgrid1.canvas.font.color:=clblue;
end;

解决方案 »

  1.   

    谢谢!
    不过这方法我试过了,不起作用,下面这句起了作用if  (gdSelected  in  State)  then 
        begin
            DBGrid1.Canvas.Brush.Color:=clYellow
            DBGrid1.Canvas.Font.Color  :=  ClBlack;
        end
    但当我该为:
    if  table1.fieldByName['whetherok']=true  then 
        begin
            DBGrid1.Canvas.Brush.Color:=clYellow
            DBGrid1.Canvas.Font.Color  :=  ClBlack;
        end
    就不起作用了?
      

  2.   

    ^_^解决了,要再加上这么一句:
     DBGrideh1.DefaultDrawColumnCell(Rect,  DataCol,  Column,  State);