【问题标题】:InvalidCastException unhandled while updating gride view更新网格视图时未处理 InvalidCastException
【发布时间】:2013-05-20 11:29:47
【问题描述】:

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

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

【问题讨论】:

  • 尝试使用带有 ID 的 FindControl 而不是 Controls[0]
  • 这是安卓吗?请提及您正在尝试的技术?

标签: gridview


【解决方案1】:

尝试使用 FindControl

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

 string att = idCombo.SelectedValue; 

【讨论】:

    猜你喜欢
    • 2012-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-13
    • 1970-01-01
    • 1970-01-01
    • 2014-01-15
    • 1970-01-01
    相关资源
    最近更新 更多