0
如何将gridview下拉列表中的选定值设置为当前记录中的内容,就像我当前对文本框所做的那样。在EditItemTemplate上设置gridview DDL的当前值
我希望用户可以查看当前值,并决定是否需要改变 - 这是我用了一个文本框:
<asp:TemplateField HeaderText="Other Notes" SortExpression="Other Notes" HeaderStyle-Wrap="false">
<edititemtemplate>
<asp:TextBox ID="txtOtherNotes" runat="server" Text='<%# Eval("[Other Notes]") %>' DataTextField="Other Notes" DataValueField="Other Notes"></asp:TextBox>
</edititemtemplate>
<itemtemplate>
<asp:Label runat="server" Text='<%# Bind("[Other Notes]") %>' ID="lblOtherNotes"></asp:Label>
</itemtemplate>
</asp:TemplateField>
你的代码片段中没有DropDownList。 – VDWWD
@VDWWD我试图在下拉列表中显示我想实现的目标,我在文本框中同样实现了这一目标。 – user2796515