ItemDataBound事件:
if (e.Item.ItemType==ListItemType.EditItem)
{
DropDownList ddl=(DropDownList)e.Item.Cells[0].FindControl("DropDownList1");
//绑定数据源
}
对应DropDownList修改Cells[0]
if (e.Item.ItemType==ListItemType.EditItem)
{
DropDownList ddl=(DropDownList)e.Item.Cells[0].FindControl("DropDownList1");
//绑定数据源
}
对应DropDownList修改Cells[0]
Using DropDownList control in DataGrid
http://www.csharphelp.com/archives/archive212.html
{
DropDownList dl=(DropDownList)yougrid.Items[i].FindControl("dropdownlistid");
dl.DataSource=......;
dl.DataTextField=.....;
dl.DataValueField=......;
dl.DataBind();
}