0

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?

2
  • a foreach will do the work I suppose Commented Jun 24, 2015 at 11:30
  • and how to select first,second and third column programatically? Commented Jun 24, 2015 at 12:16

1 Answer 1

1
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++;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.