必须禁用选中 chechbox 的行。我已使用以下代码在 RowDataBound 事件中尝试过它,但它显示错误Object reference not set to an instance of an object
。
CheckBox cbAttachClrReq = (CheckBox)gvEntity.FindControl("chkAdd");
if (cbAttachClrReq.Checked)
{
this.gvEntity.Rows[e.Row.RowIndex].Enabled = false;
}