关于“System.Web.UI.WebControls.GridViewRowCollection”并不包含“cells”的定义的问题
我在GRIDVIEW的行里帮定了DROPDOWNLIST控件,然后在CS文件里写了一个测试,代码如下:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
string temp = ((DropDownList)GridView1.Rows.cells[4].FindControl("DropDownList1")).SelectedItem.Text;
this.Label2.Text = temp;
}
怎么系统老提示我“System.Web.UI.WebControls.GridViewRowCollection”并不包含“cells”的定义?????
然后我又改成:string temp = ((DropDownList)GridView1.Rows[e.Rowindex].FindControl("DropDownList1")).SelectedItem.Text;
系统提示:“System.EventArgs”并不包含“Rowindex”的定义 ,是不是ROWINDEX和CELLS没有定义,以及它们在哪里定义?高手帮助下,谢谢!!!