ItemDataBound事件:
if (e.Item.ItemType==ListItemType.EditItem)
{
DropDownList ddl=(DropDownList)e.Item.Cells[0].FindControl("DropDownList1");
//绑定数据源
}

解决方案 »

  1.   

    <EditItemTemplate>
    <asp:DropDownList id=DropDownList1 runat="server" Width="104px" DataValueField="templateid" DataTextField="name" DataSource="<%# TempDv() %>" SelectedIndex='<%# TempIndex(DataBinder.Eval(Container,"DataItem.templateid")) %>'>
    </asp:DropDownList>
    </EditItemTemplate>
    public DataView TempDv()
    {
    return new DTemplate().GetTemplateDv();  
    } public int TempIndex(object templateid)
    {
    if (templateid==DBNull.Value)
    //templateid=0;
    return -1;
    return new DTemplate().GetTemplateIndex((int) templateid); 

    }
      

  2.   

    还可以在EditCommand里面
    DataGrid1.EditItemIndex = e.Item.ItemIndex;
    //绑定DataGrid
    //在这也可以绑定DropDownList
      

  3.   

    if(!IsPostBack)
    string[] BookStyle=new string[5]{"a","b","c","d","e"}; DropDownList1.Items.Clear();
    for(int i=0;i<BookStyle.Length;i++)
     DropDomnList1.Items.Add(BookStyle[i])
    //