Access ListView SubItem Text by Column Header
Posted on 2006-04-18
I have a ListView that I would like to access SubItem text from the selected row. The ListView is dynamically populated so I am not always sure what SubItem relates to the info I need. When populating the listview I included column headers but i am not sure how I can reference a selected listview item subItem by column header.
I can get the value with the following line, however i cant guarantee subitems(5) will be the data i need to get.
val = lvwData.Items(SelectedItemIndex).SubItems(5).Text
If I cant do this direct by column header name, is there some way i can determine the SubItems index by the known column name
Thank you for any advise