private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { var userSelect = ((System.Data.DataRowView) this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row as MVCProject.SistemaBibliotecaDBADataSet.EditorasRow; switch (e.ColumnIndex) { // Coluna Deletar case 0: { // DELETE this.editorasTableAdapter.DeleteQuery(userSelect.Id); } break; case 1: { frmEdicaoEditora edicaoEdit = new frmEdicaoEditora(); edicaoEdit.editorasRow = userSelect; edicaoEdit.editorasRow = userSelect; edicaoEdit.ShowDialog(); this.editorasTableAdapter.Update(edicaoEdit.editorasRow); } break; } this.editorasTableAdapter.CustomQuery(sistemaBibliotecaDBDataSet.Editoras); }
private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { var editoraSelect = ((System.Data.DataRowView) this.dataGridView1.Rows[e.RowIndex].DataBoundItem).Row as MVCProject.SistemaBibliotecaDBDataSet.EditorasRow; switch (e.ColumnIndex) { case 0: frmEdicaoEditora editEditora = new frmEdicaoEditora(); editEditora.editorasRow = editoraSelect; editEditora.ShowDialog(); this.editorasTableAdapter.Update(editEditora.editorasRow); break; } this.editorasTableAdapter.Fill(this.sistemaBibliotecaDBDataSet.Editoras); }