From Delphi 4 onwards I have noticed that
setting column widths in a grid via the
Properties in the OI is unreliable. And
Delphi often (inexplicably) simply ignores it.
The following code solved the problem. (I thought.)
procedure TfrmMyForm.FormCreate(Sender: TObject);
begin
dbGrd.columns.items [0].Width:= 28;
dbGrd.columns.items [1].Width:= 36;
dbGrd.columns.items [2].Width:= 36;
end;
But am now using Delphi 6 and the above
produces the following exception.
'ListIndex out of bounds[1]'
Can someone please tell me what I am missing?