解决方案 »

  1.   

    使用DXGRID控件吧,控制就简单了
      

  2.   

    如果是DBGrid就直接在OnDrawColumnCell事件中设置Canvas.Brush.Color属性值楼主说的是不是DBGrid?
      

  3.   

    在DBGrid1DrawColumnCell(Sender: TObject;
      const Rect: TRect; DataCol: Integer; Column: TColumn;
      State: TGridDrawState);
    中写代码if query1.FieldByName('seqno').asinteger>30 then
         begin
           DBGrid1.Canvas.Brush.Color := clMoneyGreen;
           DBGrid1.Canvas.Font.Color := clGreen;
           DBGrid1.Canvas.FillRect(Rect);
         end;
    if query1.FieldByName('seqno').asinteger<=30 then
         begin
           DBGrid1.Canvas.Brush.Color := clMoneyGreen;
           DBGrid1.Canvas.Font.Color := clBlue;
           DBGrid1.Canvas.FillRect(Rect);
         end;
      if quey1.FieldByName('seqno').asinteger<=20 then
         begin
           DBGrid1.Canvas.Brush.Color := clMoneyGreen;
           DBGrid1.Canvas.Font.Color := clRed;
           DBGrid1.Canvas.FillRect(Rect);
         end;
      if quey1.FieldByName('seqno').asinteger<=10 then
         begin
           DBGrid1.Canvas.Brush.Color := clMoneyGreen;
           DBGrid1.Canvas.Font.Color := clYellow;
           DBGrid1.Canvas.FillRect(Rect);
         end;
        DBGrid1.DefaultDrawColumnCell(Rect,DataCol,Column,State);
      

  4.   

    http://218.56.11.178:8020/web/index.aspx-> 下载基地->例程-数据库/报表->控制数据表每行的颜色控制数据表每行的颜色