<ItemTemplate>
<asp:DropDownList ID="ddlProjectModifiedBy" Width="99%" runat="server" Enabled="false"
onselectedindexchanged="ddlProjectModifiedBy_SelectedIndexChanged" AutoPostBack="true" >
</asp:DropDownList>
</ItemTemplate>
在代码中添加编辑模板
<EditTemplate>
<asp:DropDownList ID="ddlProjectModifiedBy" Width="99%" runat="server" Enabled="false"
onselectedindexchanged="ddlProjectModifiedBy_SelectedIndexChanged" AutoPostBack="true" >
</asp:DropDownList>
</EditTemplate>
在您的 RowDataBoound 事件中添加此代码
If e.Row.RowType = DataControlRowType.DataRow AndAlso dgrd_WWWH_How.EditIndex = e.Row.RowIndex Then
Dim ddlresp As DropDownList = CType(e.Row.FindControl("ddlResp"), DropDownList)
'Here you get your current value from db to store any string
Dim lblid as Label = CType(e.Row.Fincontrol("id"),Label)
strresp = db.getvalue(select respval from tbl where id =lblid)
ddlresp.Items.FindByText(strresp).Selected = True
End If