Reputation: 300
Suppose I have three arrays-
public bool[] A = { false, false, false, false, true, true, true, true };
public bool[] B = { false, false, true, true, false, false, true, true };
public bool[] X = { false, true, false, true, false, true, false, true };
And an empty listView named lvTAB. Is there a way to fill the first column in listView with the values of the first array,second and third respectively?
Upvotes: 0
Views: 230
Reputation: 14389
int i=0;
foreach (bool b in A)
{
string[] row = { b.ToString(), B[i].ToString(), X[i].ToString() };
var listViewRow = new ListViewItem(row);
listView1.Items.Add(listViewRow);
i++;
}
Upvotes: 1