Map ListView.Columns[].Index to ListView.Items[].SubItems index

  • Thread starter Thread starter Samuel R. Neff
  • Start date Start date
S

Samuel R. Neff

I'm having a index problem with ListView SubItems. If I add multiple
columns to the listview and then add items with associated subitems,
the ListView displays fine. Then if I delete a column via
ListView.Columns.RemoveAt() then the ListView still displays fine.
However, if I grab a subitem value via

listView.Items[itemIndex].SubItems[column.Index].Text

Then I get the Text of the wrong column.

If the ListView internally knows what Column is associated with which
SubItem, how can we find out after columns have been added/removed?

Thanks,

Sam
 
Back
Top