private void btnEdit_Click(object sender, EventArgs e) { using (Form_AddBook form = new Form_AddBook(this, curRowIndex)) { form.ShowDialog(); PopulateDataGrid(); } }
private void btnAddNewBook_Click(object sender, EventArgs e) { using (Form_AddBook form = new Form_AddBook(this, -1)) //pass index -1 to add new book instead of edit { form.ShowDialog(); PopulateDataGrid(); } }