What settings of Mouse.ColumnSizing and Comumns.Streching.* do need, so that my columns are all streched accordingly, and I can change the width of every(!) column by mouse, so, that the columns to the left and right adapt.
If you want to change every column, you can't enable stretching. Mouse.ColumnSizing is for normal cells, Mouse.FixedColumnSizing is for fixed cells (headers)
Oh. But there is a settings combination where columns strech AND I can change the width of one column at the cost of the column on the right side. Would´t this be an option for all columns?
The doc is unclear what the settings in Settings.stretching are good for - can you pls explain?
Ah yes,
procedure TForm8.FormCreate(Sender: TObject);
begin
TMSFNCDataGrid1.LoadSampleData;
TMSFNCDataGrid1.Options.Column.Stretching.Mode := gstmIndex;
TMSFNCDataGrid1.Options.Column.Stretching.Index := TMSFNCDataGrid1.Columns.Count - 1;
TMSFNCDataGrid1.Options.Column.Stretching.Enabled := True;
TMSFNCDataGrid1.Options.Mouse.FixedColumnSizing := True;
TMSFNCDataGrid1.Options.Mouse.ColumnSizing := True;
end;
This is, what I got to work. But all other columns can not be sized. Wouldn´t it be an option to enabled this? If it works for column with index i, it can work for all other columns, too. Feature request. :- )
I can set the index at runtime, I suppose, but enabling this by default would be better.
What do the various strechting modes do?
So if I understand it correctly, you want to start with a stretch mode "ALL" equally divided, and then override a particular column, and all the rest get stretched in the remaining space?
Not exactly.
What I want:
- set widths for columns (ideally in %)
- set streched to true, so the columns fill the width of the grid
- set mouse.columns.sizing (or so) to true
Now I would like to move the mouse optionally to every line between two columns and drag the line, having both(!) columns (the right and the left one) adapt in width. The width of the other columns should not change.
This already works, but for the indexed column (and the one on the right side) only.
Nice to have:
- shift-drag changes the widht of the right most column instead of the immediate right one
- ctrl-drag changes all the width of all columns on the right side equally (accordingly?)
It is a bit like Word does with its column widths.
Thank you for investigating.
Bernd
Thanks, since this is quite a significant change we'll add this on our feature request list. We plan to add more options to the mode in the future.