private void button5_Click(object sender, EventArgs e) { var id = listView1.SelectedItems[0].Index; var inforow = new addedit(mainList[id], mainList); var dialog = inforow.ShowDialog(this); if (dialog == DialogResult.OK) { mainList[id] = inforow.info; listView1.Items[id] = new ListViewItem(new string[] { mainList[id].PhoneNumber, mainList[id].FullName, mainList[id].Tariff.ToString() }); } }