急求gridview动态生成绑定控件取值问题,重分相送!!
gridview列是动态生成,然后给了两个事件如下:
protected void gvInfo_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string c;
string[] ac;
for (int i = 3; i < e.Row.Cells.Count; i++)
{
c = e.Row.Cells[i].Text;
ac = c.Split( ', ');
DropDownList ddl = new DropDownList();
ddl.ID = "ddlRow " + e.Row.RowIndex.ToString() + i.ToString();
ddl.DataSource = ac;
ddl.DataBind();
ddl.EnableViewState = true;
e.Row.Cells[i].Controls.Add(ddl);
}
}
}
protected void gvInfo_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string c;
&