public void AddButton_Click(object sender, EventArgs e) { using (var form = new EditPersonForm()) { form.ShowDialog(); } UpdateGrid(); }
public void EditButton_Click(object sender, EventArgs e) { var p = accountDataGrid.CurrentRow?.DataBoundItem as Person; if (p == null) { return; } using (var form = new EditPersonForm(p)) { form.ShowDialog(); } UpdateGrid(); }