private void btnDelete_Click(object sender, EventArgs e) { if (dataGridView.SelectedRows.Count > 0) { var engine = dataGridView.SelectedRows[0].Cells; var engineId = int.Parse(engine[0].Value.ToString()); EngineBusiness engineBusiness = new EngineBusiness(); engineBusiness.Delete(engineId); PopulateDataGridViewDefault(); ResetSelect(); } }