For this you need to follow this steps..
1)create and attache row data bound event to your gridview...
2) in that event find your row type like if it is datarow or edirrow or header or footer where you want to find your dropdown...
3) now cast that control to dynamic created dropdown using findcontrol method..
4) wirte the code to get the all data attach to that dropdwon
5) after this you need to get the selected dataitem from your command argument from grid event...
6) set it to the selected value of that dropdown...
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType = DataControlRowType.DataRow)
{
if (GridView1.EditIndex != -1)
{
DropDownList ddl = (DropDownList)e.Row.FindControl("Your DROPDOWN ID");
string selectQuery = "select * from xyztable";
DataTable dt = new DataTable();
ddl.DataSource = dt;
ddl.DataBind();
string selectedValue = ((DataRow)e.Row.DataItem)["YOU COLUMN NAME"].ToString();
ddl.SelectedValue = selectedValue;
}
}
if (e.Row.RowType = DataControlRowType.Header)
{
}
if (e.Row.RowType = DataControlRowType.Footer)
{
}
}