更新gridview时未处理InvalidCastException

时间:2013-05-20 11:29:47

标签: gridview

您好我收到错误InvalidCastException unhandled请帮我解决这个问题。

string att = ((DropDownList)GridView1.Rows[e.RowIndex].Cells[0].Controls[0]).Text;

1 个答案:

答案 0 :(得分:0)

尝试使用 FindControl

 DropDownList idCombo = (DropDownList)GridView1.Rows[e.RowIndex].Cells[0].FindControl("comboID");

 string att = idCombo.SelectedValue; 
相关问题