private void btnEdit_Click(object sender, EventArgs e) { Person person = (Person)bindSrcTowns.List[bindSrcTowns.Position]; PersonForm ft = new PersonForm(person); if (ft.ShowDialog() == DialogResult.OK) { bindSrcTowns.List[bindSrcTowns.Position] = person; } }
private void btnAdd_Click(object sender, EventArgs e) { Person person = new Person(); PersonForm ft = new PersonForm(person); if (ft.ShowDialog() == DialogResult.OK) { bindSrcTowns.Add(person); } }