I have the following requirement fo the grid:
- There are several columns, some are fixed size and some can be resized by the user
- When the complete grid is resized, the variable columns should be resized with a constant factor
Enabling AutoSize for the variable columns doesn't give me the desired effect. Perhaps I am doing something wrong.
These are the unexpected effects I see:
- While designing in the IDE, when I set AutoSize for one column, everything is fine. As soon as I continue with the next columns, the width ratio between the columns begin to differ.
- start with 4 columns all width = 80
- set first column to AutoSize, width changes to 124 (assuming that we have 44 free space)
- set second column to AutoSize, width changes to 132, but first column width changes to 72 (expected: 102 each, because 80 + 80 + 44 = 204)
- set third column to AutoSize will give the following widths for the 4 columns: (61, 111, 111, 80)
- set fourth columns to AutoSize will give result to (56, 102, 102, 103)
It looks like the problem is the step from 1 to 2 AutoSize columns.
- After making all of the AutoSize columns equal sized again, I start the program and all designed width are changed in a way that column 1 and 2 are not even visible, column 3 is pretty small and column 4 takes more space as is available, so that a horizontal scrollbar is shown.
- Manually sizing the columns is not very intuitive, probably because the AutoSize mechanism is stepping in trying to do its job. When you move a grid line between two AutoSize columns it affects all AutoSize columns instead of only the two next to that line.
I have attached the test project.
Is there something else I have to take into account when setting AutoSize to True for several columns?