Hello all.
I have a ListView on a form, that has columns added at design-time but
will be populated run-time. So, I know what the columns will be, and I
know that I will have an arbitrary number of 'rows' in the ListView,
anywhere from 1 to 100 or even 1000.
The purpose of the program is to allow a user to keep an eye on tickets
in a ticketing database.
The user selects a ticket type from a drop down, and enters a ticket
number in a text box, then clicks 'add'. This adds those strings to
the first two columns of the ListView, and I want to be able to fill in
the rest of the columns of that 'row' programmatically based on data
from a database.
How do I access each element in the 'rows'? I use "rows" because I
don't know of a more correct term.
All I've gotten so far is this:
foreach (ListViewItem lvi in lvRecords.Items) {
}
I've tried accessing lvi.SubItems but I'm not at all sure how to make
it work.
Can anyone share information on how to access individual cells in the
ListView programmatically?