C # ListView problem adding items
So here is my question: why the code in the first snippet doesn't work when the second one works fine. Also, I have set the view property for the details. I have read all how to add lvi to a list and it fails every time ... also, I do it manually.
So this doesn't work ...
// Iterating through the rows...
for (int x = 0; x < numRows; x++) {
row = new List<string>();
// Iterating through the cols...
for (int y = 0; y < numCols; y++) {
row.Add(data[y][x]);
}
lv.Items.Add(new ListViewItem(row.ToArray()));
}
But this will work:
lv.Items.Add(new ListViewItem("foo"));
0
a source to share
2 answers