private void editButton_Button_Pressed(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { DataRow sourceRow = (DataRow)listView1.SelectedItems[0].Tag; SobekCM_Builder_Incoming_Folder_Form newForm = new SobekCM_Builder_Incoming_Folder_Form(sourceRow); this.Hide(); DialogResult result = newForm.ShowDialog(); this.Show(); if (result == DialogResult.OK) { folderTable = Database.SobekCM_Database.Get_Builder_Incoming_Folders(); // Now, add these to the table listView1.Items.Clear(); foreach (DataRow thisRow in folderTable.Rows) { ListViewItem newListItem = new ListViewItem(new string[] { thisRow["FolderName"].ToString(), thisRow["NetworkFolder"].ToString() }); newListItem.Tag = thisRow; listView1.Items.Add(newListItem); } deleteButton.Button_Enabled = false; editButton.Button_Enabled = false; } } }