我试图在尝试访问其刚刚给出的错误时选择网格中存在的 sql 的位值。
protected void ProductGrid_SelectedIndex(object sender, EventArgs e) { PRID.Text=RequisitionGrid.SelectedRow.Cells[1].Text;
vid.Text=RequisitionGrid.SelectedRow.Cells[2].Text;
vaddress.Text=RequisitionGrid.SelectedRow.Cells[3].Text;
BrandID.Text=RequisitionGrid.SelectedRow.Cells[4].Text;
prodID.Text=RequisitionGrid.SelectedRow.Cells[6].Text;
quantity.Text=RequisitionGrid.SelectedRow.Cells[7].Text;
description.Text=RequisitionGrid.SelectedRow.Cells[5].Text;
date.Value = RequisitionGrid.SelectedRow.Cells[8].Text;
approvecheck.Checked = Convert.ToBoolean(RequisitionGrid.SelectedRow.Cells[9]);
}
我也试过
approvecheck.Checked = (RequisitionGrid.SelectedRow.Cells[9].Text == "1");
它没有给出错误但对复选框没有响应