Reputation: 13454
I've created a table from a TcxGrid
with a simple table view. The data is being poked into the table using DataController.Values[n,m]
as a simple string and I have some 10 columns that will show various string widths.
The problem that I'm having is getting a table that has a horizontal scroll bar AND has auto-sized its columns. If I set CellAutoWidth
true this fits all columns into the display width (with no scroll bar) but if I set it false, I get a scroll bar but columns of my default width and my data strings are truncated.
Could some kind person tell me how to get a horizontal scroll bar AND get each column to adjust its width to fit its max data width please?
Thanks Brian.
Upvotes: 5
Views: 19040
Reputation: 6078
You need to set columns BestFitMaxWidth
and MinWidth
property and make sure you have the width of the Datasets TField
also set (if you are using DataSets).
Then, you can call YourGridView.ApplyBestFit
;
Upvotes: 1
Reputation: 13991
Maybe it's enough to call YourGridView.ApplyBestFit
instead of using CellAutoWidth
.
Upvotes: 12