假如你在gridview中添加一个模板列,并 在模板列中存放了一个dropdownlist控件。那么,问题就是:你如何去操作这个dropdownlist控件????
//对于gridview控件: 
System.Web.UI.WebControls.GridViewRow rows = (GridViewRow)((Control)sender).Parent.Parent;//获取对于ui层次结构中服务器控件的父控件的父控件的引用
        DropDownList list = (DropDownList)rows.FindControl("DropDownList1");
//对于datagrid控件:
 System.Web.UI.WebControls.DataGridItem item = (DataGridItem)((Control)sender).Parent.Parent;//获取对于ui层次结构中服务器控件的父控件的父控件的引用
        DropDownList list = (DropDownList)rows.FindControl("DropDownList1");
其实运用的就是findcontrol方法。
System.Web.UI.WebControls.GridViewRow rows = (GridViewRow)((Control)sender). Parent.Parent;// 获取对于ui层次结构中服务器控件的父控件的父控件的引用
对于这个还不理解。
 
VB.NET 写法如下:
 
Dim rows As System.Web.UI.WebControls.GridViewRow = CType(CType(sender, Control).Parent.Parent, GridViewRow) '//获取对于ui层次结构中服务器控件的父控件的父控件的引用
        Dim dropList As DropDownList = CType(rows.FindControl("DropList_Level"), DropDownList)
        Page.Response.Write("alert('" + dropList.SelectedValue.ToString + "')")