TAdvTreeView: EndUpdate is reseting the columsize

If ColumnAppearance.Stretch is False then an EndUpdate resets the size of columns to the original width.
As sample you can drag a TAdvTreeView and two buttons to your form and add the foillowing code:

procedure TForm1.FormCreate(Sender: TObject);
begin
AdvTreeView1.ColumnsAppearance.Stretch := False;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
AdvTreeView1.ExpandAll;
AdvTreeView1.AutoSizeColumn(0); // Column 0 has the right size now
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
AdvTreeView1.BeginUpdate;
AdvTreeView1.EndUpdate // Column size is reseted :-(
end;

Can I avoid that behaviour somehow?

After Button1Click:

After Button2Click:

Hi,

When auto-sizing, it updates the internal width of the column temporarily. When calling BeginUpdate&EndUpdate, the width of the column gets reset to whatever value the property Width has at column level. To work around this, you can synchronize the width with the following code:

  TMSFNCTreeView1.Columns[0].Width := TMSFNCTreeView1.GetColumnWidth(0);

Hi Peter,
in my opinion that is a strange behaviour but your description for the workaround does the job.
Thanks
Karsten