listView1.Columns.Add("Item name / title", 400); listView1.Columns.Add("Selling price", 70); listView1.Columns.Add("Quantity / In stock", 100); using (StreamReader sr = new StreamReader(@"test.txt")) { while (-1 < sr.Peek()) { try { string name = sr.ReadLine(); string email = sr.ReadLine(); string quantity = sr.ReadLine(); var lvi = new ListViewItem(name); lvi.SubItems.Add(email); lvi.SubItems.Add(quantity); listView1.Items.Add(lvi); } catch (Exception) { } } sr.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)