Hi Dynapta, Hi Jean,
Just to expand a little on Jean's reply, you can autofit columns depending on
1. the header (bfheader),
2. the data in the column ()
3. both the data and the header (bfboth).
You can also specify, for discrete columns
4. a specific initial column width which can be manually altered,
5. lock the column width so that the User can't change it.
All of the above are done using a script. Please see the attached example - in the script, each option is commented out - just remove the '//' against each option then run the example to see the effect.
You can also use these options in combination - for example, let the data interactively adjust the column by using form1.tablegrid1.bestfitcolumns(); but prevent the User from adjusting, for example, Column0, by using form1.tablegrid1.columns[0].options := form1.tablegrid1.columns[0].options - cofixedsize;
I've probably made that sound way more complicated that it actually is - just play around with the attached example and all will be revealed (I hope - LOL!)
Derek.
Post's attachments gazeteer.zip 350.98 kb, 278 downloads since 2019-08-12