Adjust Column width DBGrid
问题 I have a TDBGrid. It works, but the columns shown are very large. How can I set an "auto-fix column width"? 回答1: The needed Columnwidth is depended of the settings of the Grids canvas and the mamimum length of the displaytext of each field. procedure FitGrid(Grid: TDBGrid); const C_Add=3; var ds: TDataSet; bm: TBookmark; i: Integer; w: Integer; a: Array of Integer; begin ds := Grid.DataSource.DataSet; if Assigned(ds) then begin ds.DisableControls; bm := ds.GetBookmark; try ds.First; SetLength