Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto-size a DevExpress TcxGrid

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.

like image 201
Brian Frost Avatar asked Dec 17 '22 19:12

Brian Frost


1 Answers

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

like image 160
Uli Gerhardt Avatar answered Dec 27 '22 10:12

Uli Gerhardt