procedure ttt.GridDGDrawColumnCell(Sender: TObject; const Rect: TRect;
  DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
begin
  if column=Griddg.Columns[5] then   Griddg.Canvas.TextOut(Rect.left, Rect.top, '555') 
else exit;
end;
不要单步调试,这样不一定行,可能要重载

解决方案 »

  1.   

    procedure ttt.GridDGDrawColumnCell(Sender: TObject; const Rect: TRect;
      DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
    begin
      if column=Griddg.Columns[5] then   Griddg.Canvas.TextOut(Rect.left, Rect.top, '555');
      DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
     //加上这句;
    end;
      

  2.   

    if column=Griddg.Columns[5] then   
    好象有问题
    试试
    if column=5 then