private void toolStripButton3_Click(object sender, EventArgs e) { var f = new FormAddEditEntry(); f.Text = "Edit"; var config = (IPConfiguration)dataGridView1.SelectedRows[0].DataBoundItem; f.ucConfigEntry1.SetConfiguration(config); if (f.ShowDialog() == DialogResult.OK) { var i = _configuration.IndexOf(config); _configuration.RemoveAt(i); _configuration.Insert(i, f.ucConfigEntry1.GetConfigurtaion()); UpdateConfiguration(); } }
private void toolStripButton1_Click(object sender, EventArgs e) { var f = new FormAddEditEntry(); f.Text = "Add"; if (f.ShowDialog() == DialogResult.OK) { _configuration.Add(f.ucConfigEntry1.GetConfigurtaion()); UpdateConfiguration(); } ; }