private void dgvOffence_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex >= 0) { offense = (Offense)dgvOffence.Rows[e.RowIndex].DataBoundItem; fillPanel(); panelOffence.Visible = true; bDelete.Visible = true; } }