autosize dbgrid lazarus / 16-Databases ---------------------------------------------------------------------- Hansvb · 2014-12-25 08:45 Is it possible to set the autosize of a dbgrid on true and then expand all columns width with an extra width of 10? ---------------------------------------------------------------------- cpalx · 2014-12-25 23:01 Can you try dbfrid.coloum[].with:= ..... In ondraw event ---------------------------------------------------------------------- Hansvb · 2014-12-26 20:20 This works: If anyone has e better solution then reply please. Code: [Select]private   append_dbgrid_field_width : Boolean; in the on create of the form: append_dbgrid_field_width := False; procedure TMain_frm.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;   DataCol: Integer; Column: TColumn; State: TGridDrawState); var   i : Integer; begin   if append_dbgrid_field_width = false then     begin       for i :=0  to DBGrid1.Columns.Count -1 do       DBGrid1.Columns.Items[i].Width := DBGrid1.Columns.Items[i].Width + 10;       append_dbgrid_field_width := True;     end; end;