protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.DataItem != null) { //初始化dropdownlist的时候,下面的这个判断是最重要的 if (e.Row.RowState == DataControlRowState.Edit || e.Row.RowState == (DataControlRowState.Alternate | DataControlRowState.Edit)) { DropDownList ddl = (DropDownList)e.Row.FindControl("DropDownList2"); } } }