Code 1protected void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e) 2 { 3 4 if (e.Item.ItemType == ListItemType.EditItem) 5 { 6 DropDownList ddl = new DropDownList(); 7 ddl = ((DropDownList)(e.Item.FindControl("ddlRatingClass"))); 8 ddl.DataSource = RatingClass.getRatingClass().DefaultView; 9 ddl.DataTextField = "RatingClassName";10 ddl.DataValueField = "RatingClassName";11 ddl.DataBind();12 }13 } 转载于:https://www.cnblogs.com/higou/archive/2008/10/18/1314068.html