C # - How to get / set ListViewItem or ListViewItem.ListViewSubItem by key?

I have a list with several elements that are created dynamically, each of which has two sub-elements, which are the quantity and code after the database query has to update the quantity, but to make the code more readable, I would like to access the sub-items using a key, not its index, something like:

subelement ["quantity"]

but I don’t see how to assign a key, although collections.

+3
source share
1 answer

You must set the property Nameto ListViewItemor ListViewSubItemto use the key.

ListViesSubItem :

Name ListViewItem..:: ListViewSubItem ListViewItem..::. ListViewSubItemCollection.

ListViewItem.

+8

Source: https://habr.com/ru/post/1736022/


All Articles