This is my first foray into C# WinForms, and I'm trying to create a ListView grid.
My code looks like this:
listView1.Columns.Add("Name", 100);
listView1.Columns.Add("Col2", 200);
listView1.Columns.Add("Col3", 300);
string[] arr = new string[3];
arr[0] = "product_1";
arr[1] = "100";
arr[2] = "10";
string[] arr2 = new string[3];
arr[0] = "product_2";
arr[1] = "200";
arr[2] = "20";
ListViewItem itm = new ListViewItem(arr);
ListViewItem itm2 = new ListViewItem(arr2);
listView1.Items.Add(itm);
istView1.Items.Add(itm2);
But the output looks like this:
So a few questions here:
- Why do I not see column names?
- Why do I not see grid lines?
- Why is only the last entry being displayed (product2)?
- Why is there no information other than the string "product2" displayed, rather than the other column entries?
Any help is greatly appreciated!

arr2but are still assigning toarr:arr[0] = "product_2".