If you add a new column between existing columns during runtime, the subitem indices are not like I'ld assume.
e.g. after adding a new column between the second and third column the columns/subitems look like this:
colums[0] | colums[1] | (new) columns[2] | columns[3]
caption | subitems[0] | subitems[2] | subitems[1]
but i would assume:
colums[0] | colums[1] | (new) columns[2] | columns[3]
caption | subitems[0] | subitems[1] | subitem[2]
I need to be able to dynamically update the subitem's content under some conditions. That's why I would like to rely on the assumption, that the subitem for a column with Column.Index = X is at Item.SubItems[X-1].
Do you think this is a default and designated behavior? If so, what would you suggest for updating the subitems according to the columns. A possibility might be saving the subitem index that belongs to the recently added columns.
Note: The Columns.Tag-property is already in use.
I`m using Delphi XE and XE2, but I need to be compatible with Delphi 7 and higher.