Hi there,
for most cases AutoFit-Layout in WinGrid works fine. But sometimes we have columns that should have a fixed width combined with columns that should use most of the available space.
Is a layout as shown in the image below possible to achieve with WinGrid?
Under the columns I have written the desired column settings. 9 columns have a fixed width. One column should 33%, another should take 66% of the available rest.
Thanks for any help.
Achim
Hi,
Yes, I think this should be possible. What you do is set MinWidth and MaxWidth on the columns you want fixed. You would, of course, set both properties to the same value, to lock the column into a fixed width. The other (sizable) columns will be the only ones that size by AutoFit.
Thank you Mike. This works fine for me.
The only question I have left is: can I specify a "column weight" for the flexible columns?
There's no weight, exactly. But if you set AutoSizeMode to ResizeAllColumns, then the remaining columns will be size proportionally, based on their initial widths.
Another option would be to use RowLayouts, which actually does let you specify WeightX and WeightY on each column.
Ok thank you all for your help. I'll try both solutions.
- Achim