So, trying to use the ListView and fill it with data.
ListViewItem item = new ListViewItem("Test");
item.SubItems.Add("1");
item.SubItems.Add("2");
MyListView.Items.Add(item);
Now, I haven been searching and reading and I feel so stupid cause I just can't figure out how the items/subitems work.
The above code won't do anything :/
foreach (Ingredient o in list) { ListViewItem lvi = new ListViewItem(); lvi.Text = o.iName; lvi.SubItems.Add(o.iUnit); lvi.SubItems.Add(Convert.ToString(o.iCalories)); listView1.Items.Add(lvi); }
It works now, BUT, I no longer have access to the items. How do I know get back an item, or change stuff in an item?