DataGridItem dgi=(DataGridItem)yourdatagird.Controls[0].Controls[yourdatagird.Controls[0].Controls.Count-1];DropDownList myDropDownList= (DropDownList)dgi.FindControl("DD_HotelList");

解决方案 »

  1.   

    DataGridItem dgi=(DataGridItem)yourdatagird.Controls[0].Controls[yourdatagird.Controls[0].Controls.Count-1];DropDownList myDropDownList= (DropDownList)dgi.FindControl("yourcontrlID");
      

  2.   

    在页面中声明一个DropDownList:
    protected DropDownList myDropDownList;在DataGrid1_ItemDataBound事件中找到这个DropDownList,并赋给myDropDownList,在别的事件中就能直接使用这个myDropDownList了:
    private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
    {
    if(e.Item.ItemType == ListItemType.Footer)
    {
    myDropDownList = (DropDownList)e.Item.FindControl("dropdownlistid");
    }
    }
      

  3.   

    dongchuanlu(匡奇) :
    你的方法中yourdatagird.Controls[0]是什么意思?取得的是什么控件?
    yourdatagird.Controls[0].Controls中又是哪些控件集合?
    望解释一下.
      

  4.   

    up
    你的方法中yourdatagird.Controls[0]是什么意思?取得的是什么控件?
    yourdatagird.Controls[0].Controls中又是哪些控件集合?哪位解释一下呀