在itemDataBound事件绑定的时候需要加上对e.item.itemtype的判断
如:
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
//e.Item.Cells[0].Text="<input type=text>";
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem)
{
DropDownList temp=(DropDownList)e.Item.Cells[1].FindControl("drop");
····
}
}