private void butLeft_Click(object sender, EventArgs e) { if (gridMain.SelectedIndices.Length == 0) { return; } //If any of the selected required fields have a field condition, prompt the user to confirm before deleting the conditions if (_listReqFields.FindAll(x => gridMain.SelectedIndices.Contains(_listReqFields.IndexOf(x))).Any(x => x.ListRequiredFieldConditions.Count > 0) && !MsgBox.Show(this, MsgBoxButtons.YesNo, "Do you want to delete the selected required fields and any conditions from the list?")) { return; } RequiredField reqField; for (int i = 0; i < gridMain.SelectedIndices.Length; i++) { reqField = _listReqFields[gridMain.SelectedIndices[i]]; RequiredFields.Delete(reqField.RequiredFieldNum); } RequiredFields.RefreshCache(); FillAvailable(); FillMain(); gridConditions.BeginUpdate(); gridConditions.ListGridRows.Clear(); gridConditions.EndUpdate(); labelExplanation.Text = ""; checkMedicaidLength.Visible = false; }