我正在尝试读取 gridview 只读列的列值。但是由于 指定的参数超出了有效值的范围,所以会出错以下是我在 asp.net gridview 中的 rowupdate 事件中的代码
protected void branchgrid_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
comp.ADMISSIONNUMBER = Convert.ToInt32((TextBox)studacgrid.Rows[e.RowIndex].FindControl("AdmissionNumber"));
//comp.ADMISSIONNUMBER = Convert.ToInt32(studacgrid.Rows[e.RowIndex].Cells[1]
comp.MEDIUM =Convert.ToString ((TextBox)studacgrid.Rows[e.RowIndex].FindControl("Medium"));
comp.CLASSNAME =Convert.ToString ((TextBox)studacgrid.Rows[e.RowIndex].FindControl("Class"));
comp.ACADAMICYEAR = Convert.ToString((TextBox)studacgrid.Rows[e.RowIndex].FindControl("Academicyear"));
comp.SECTIONNAME = Convert.ToChar(((TextBox)studacgrid.Rows[e.RowIndex].Cells[7].Controls[0]).Text.ToString());
}