这是我在 rowdatabound 事件中的编辑代码。
if (e.Row.RowType == DataControlRowType.DataRow)
{
if ((e.Row.RowState & DataControlRowState.Edit) > 0)
{
DropDownList dl = (DropDownList)e.Row.FindControl("Sectionname");
comp.MEDIUM = Convert.ToString(e.Row.FindControl("Medium"));
comp.CLASSNAME = Convert.ToString(e.Row.FindControl("ClassName"));
comp.ACADAMICYEAR = Convert.ToString(e.Row.FindControl("AcademicYear"));
DataTable worktype = inter.bindsectionforgird(comp);
dl.DataSource = worktype;
dl.DataTextField = "SectionName";
dl.DataValueField = "SectionId";
dl.DataBind();
}
}
我仍然无法获得这些字段的值。