How to adjust DevExpress TcxGrid size

I created a table from TcxGrid with a simple table view. The data is inserted into the table using DataController.Values ​​[n, m] as a simple row, and I have about 10 columns that will display different row widths.

The problem I ran into is getting a table with a horizontal scrollbar and automatically adjust its columns. If I set CellAutoWidth true, it will fit all the columns in the width of the screen (without a scroll bar), but if I set it to false, I get a scroll bar, but my default width columns and my data rows are truncated.

Can someone tell me how to get a horizontal scrollbar? And get each column to adjust its width so that it matches the maximum data width?

Thanks Brian.

+3
source share
2 answers

Perhaps this is enough to call YourGridView.ApplyBestFit instead of using CellAutoWidth.

+10
source

You need to set the columns of the BestFitMaxWidth and MinWidth properties and make sure that you also have the Datasets TField width set (if you are using DataSets). Then you can call YourGridView.ApplyBestFit;

0
source

Source: https://habr.com/ru/post/1780820/


All Articles