سؤال

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.

هل كانت مفيدة؟

المحلول

Maybe it's enough to call YourGridView.ApplyBestFit instead of using CellAutoWidth.

نصائح أخرى

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;

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top