修改DBGrid控件的OnDrawColumeCell事件
例如:
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect:TRect;DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
  if Table1.FieldByName('int').AsInteger > 10000 then
  DBGrid1.Canvas.Font.Color := clBlue;DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);end;
希望对你有用!

解决方案 »

  1.   

    在Dbgrid的OnDrawcolumncell上编程可对某一列变色,如下:
     if Column.fieldname='yourfield' then
     DBgrid1.canvas.brush.color:=(yourcolor);//将底色改变
     DBgrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);至于选中某一行要使其变色,则可用Rxlib控件中的TRxDbgrid控件
      

  2.   

    先将dbgrid的option设dbrowselect为true 
    procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
      DataCol: Integer; Column: TColumn; State: TGridDrawState);
    begin
    if (gdSelected in State) then
          begin
            DBGrid1.Canvas.Brush.Color := clTeal;//选中
            DBGrid1.Canvas.Font.Color :=clWhite ;//字体
          end
    end; 
      

  3.   

    还要加上这句
     DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);