private void btnEdit_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { for (int i = 0; i < dataGridView1.SelectedRows.Count; i++) { Form f = new FrmSchoolEdit ( dataGridView1.SelectedRows[i].DataBoundItem as School, loadData ); f.ShowDialog(); } } }
private void btnAdd_Click(object sender, EventArgs e) { Form f = new FrmSchoolEdit(loadData); f.Show(); }