protected void ddlCode_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList ddlCode = (DropDownList)sender;
//根据现有的控件的NamingContainer获取到该控件所在的父级GridView的所在行
GridViewRow gvr = (GridViewRow)ddlCode.NamingContainer;
//根据获得的gvr使用同样的属性获得外层的GridView
GridView gv = gvr.NamingContainer as GridView;
//获取gvr的行索引
int i_RowIndex = gvr.RowIndex;
}