private void btnObrisi_Click(object sender, EventArgs e) { bool uspjeh = false; if (dgvStudenti.SelectedCells.Count > 0) { if (MessageBox.Show("Are you sure you want to delete the selected student?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes) { int indeksOznacenog = dgvStudenti.SelectedCells[0].RowIndex; DataGridViewRow oznaceniRed = dgvStudenti.Rows[indeksOznacenog]; int ID = int.Parse(oznaceniRed.Cells["IDStudenta"].Value.ToString()); uspjeh = Upiti.ObrisiStudenta(ID); } } if (uspjeh) { OsvjeziPrikaz(); } }