private void GVWuserTran_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (GVWuserTran.Columns[e.ColumnIndex].Name == "chk") { if (NOTBatchReview != null && NOTBatchReview.IndexOf(GVWuserTran.Rows[e.RowIndex].Cells["NodeName"].Value.ToString()) > -1) { MessageBox.Show("当前节点不能批量审核!", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Information); GVWuserTran.BeginEdit(!false); GVWuserTran.Rows[e.RowIndex].Cells["chk"].Value = false;//修改选择框选中状态; GVWuserTran.EndEdit(); } } } /// <summary> /// CurrentCellDirtyStateChanged 方法提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GVWuserTran_CurrentCellDirtyStateChanged(object sender, EventArgs e) { if (this.GVWuserTran.IsCurrentCellDirty) { this.GVWuserTran.CommitEdit(DataGridViewDataErrorContexts.Commit); } }