type  array of integer.
procedure  TForm1.DBGrid1DrawColumnCell(Sender:  TObject;  const  Rect:  TRect;  
    DataCol:  Integer;  Column:  TColumn;  State:  TGridDrawState);  
begin  
///////Begin  保留  
    if  XXX[Column.Field.Index]  <    Canvas.TextWidth(Column.Field.DisplayText)  then  
        XXX[Column.Field.Index]  :=  Canvas.TextWidth(Column.Field.DisplayText);  
///////End  保留  
end;
伴水早回答过这个问题了。