Hello,
I have massive troubles with a grid which refuses to autosize (shrink horizontally in my case).
I compared the settings of this grid with another grid where it's working multiple times but I couldn't find a property which I forgot to set.
If you could tell me all properties which influence the autosize behavior I can check them. Or maybe you know another method to find the invalid setting.
Thanks and best regards, Gerald
Hi Gerald,
What kind of AutoSizing are you referring to?
Are you talking about columns?
Rows?
The grid itself?
And what is it you want to autosize it based on?
Hello Mike,
it's the width of the columns.
Regards, Gerald
Okay, so if you want to autosize a column widthso that the contents of the column fit, you need to call the PerformAutoResize method on the column. In the latest version of the grid, there are PerformAutoResize methods on the band and the DisplayLayout, too, which will size all columns.
If you mean you want to fit the columns within the grid so there's no horizontal scrollbar, then you would use the AutoFitStyle property on the DisplayLayout.
I tried all of it. It's still not working. I don't have set any minimum size (width) but the grid still stops shrinking at some point although there would be plenty of space in each of the columns.
I just struggled this same issue. I had to change AutoFitStyle in the designer to some value other than "none" foo the colums to autoresize based on their content
I'm not sure what's going on, then. The PerformAutoResize method on a column definitely works. I use it all the time.
If it's a question of the column not resizing smaller, then maybe it's because the columns in every band are in synch.Isyour data hierarchical? If so, try setting AllowColSizing to Free and see if that helps.