<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>
このコードを RowDataBound イベントに追加します
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