.net教程:东方兄,我搞定了,看代码
public void datagrid1_edit(object sender,datagridcommandeventargs e)
{
string strsql;
string connectionstring;
connectionstring = configurationsettings.appsettings["connectionstring"];
datagrid1.edititemindex =(int)e.item.itemindex;
bindgrid();
dropdownlist ddl = (dropdownlist)(datagrid1.items[e.item .itemindex].cells [4].controls [1]);
strsql = "select workstate,itemnumber from asp_temp";
oledbconnection myconn=new oledbconnection(connectionstring );
oledbcommand mycommand=new oledbcommand (strsql,myconn);
myconn.open();
oledbdatareader myreader=mycommand.executereader();
ddl.datasource =myreader;
ddl.datatextfield ="workstate";
ddl.datavaluefield = "itemnumber";
ddl.databind ();
myreader.close();
myconn.close();
}