TAdvStringGrid - AutoSizeColumns breaks after setting rowcount with collapsed nodes

I have recently updated from version 6.0.something of the TMS grids to the latest version (8.6.14.1) on my Delphi 2010 system.

I have a string grid with nodes that I populate with an arbitrary number of rows, and then trim once the data is filled by calling
AdvStringGrid1.CollapseAll;
AdvStrinGrid1.RowCount := HeaderCount + 1;

This has worked fine previously, but with the latest version this causes an error on calling AutoSizeColumns: Index (-1) is out of bounds.

On investigating, it looks like this is occurring in the SizeToWidth procedure on line 52889 on the procedure IsXMergedCell (and then line 1039 of the BaseGrid unit) on trying to get the CellProperties of the row no (n-i + 1), where n is the original arbitrary number and i is the number of child rows that were hidden by the contract all. i.e. if I started with 50 rows and hid 14 child rows, it occurs on row no 37.

I presume that setting the rowno while the nodes are collapsed is removing some of the CellProperties from these child rows.

I have developed a work around in my software, but would appreciate if this could be fixed ASAP

I do not understand the purpose of setting grid.RowCount after you called CollapseAll.
CollapseAll will hide rows and when you just change grid.RowCount after row hiding, this interferes.
I suggest to

  1. cut off row count if needed and then group & collapse
    or
  2. try to see if setting grid.FilterType = ftSuppress helps