private void ClickDelete(object arg1, EventArgs arg2) { Step entity = this.myTestStepGridView.FindFirstSelect <Step>(); if (this.Entity == null) { logger.Info("测试项配置新增和修改界面、测试步骤删除时无选中信息"); return; } if (entity != null) { if (MessageBox.Show("是否删除数据?", "确认", MessageBoxButtons.OKCancel) == DialogResult.OK) { this.Entity.StepList.Remove(entity); this.stepList.Remove(entity); bll.Select(this.Entity.Id).StepList.Remove(entity); this.Sort(); this.myTestStepGridView.LoadData(this.stepList, base.ignoreFields); } } }