Setting width of DBGrid at runtime

Setting width of DBGrid at runtime

Post by Thomas Mar » Sun, 31 Dec 1899 09:00:00



(Delphi 1.02)
I have a DBGrid with 3 fields, say 'name', 'city' and 'zipcode'. What
I would like to do is to set the width of the grid (at runtime) in
such a way that the 3 fields fit exactly into the grid, i.e. there
should be no empty space on the right part of the grid, and there
should be no horizontal scrolling bar either.
How can I get the width of each column displayed ?
The property Fields[..].displaywidth just gives me the number of
characters...

Thanks for any help !

Thomas