第二个,修改为这样:e.Item.Controls[0].FindControl("DropDownList1");

解决方案 »

  1.   

    e.Item.Cells[2].FindControl("DropDownList1");
      

  2.   

    确定DropDownList1是你定义的DropDownlist的ID
      

  3.   

    那么DropDownlist1是随便写的吗?
      

  4.   

    我忘了你前面那个帖子的具体要求 :(
    如果你只是想在编辑是使用DropDownList而不是TextBox,那你可以把这一列转换成模板列,并在HTML中修改,把EditTemplate里面的TextBox控件去掉,加入一个DropDownList。
    这样在代码里面就可以用
    DropDownList list = (DropDownList)e.Item.FindControl("DropDownList1");
    来查找这个DropDownList控件。