Hi,
after adding a new row or updating data, I would like for the wingrid to automatically resize the rows. There are some resize functions but I cannot get them to work the way I want them to.
What I would like is a resized row, depending on the data in the columns (so columns with more data get greater width), which always takes the full grid width. Only when the data is really too much to fit in there I could live with scrollbars, but rather not.
How to acheive this?
I think you will want to set AutoFitStyle to get the colmuns to fill the width of the grid.
To automatically size a column to it's content, you can use the PerformAutoResize method of the grid. I'm pretty sure that if you call PerformAutoResize on every colmun in the grid and the total width happens to be wider than the grid, then the AutoFitStyle will not be honored, which it what you want.
Got it.
Set grid.DisplayLayout.AutoFitStyle to AutoFitStyle.ResizeAllColumns and then call PerformAutoSize() on each grid in the collection grid.DisplayLayout.Bands[0].Columns.
Thanks!