C# 解决 DataGridView 选择按钮后台修改以后页面不更新

  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);
            }
        }
原文地址:https://www.cnblogs.com/pyf97/p/14231348.html