January 14, 2022 at 8:30 pm
I am working to get a drop down to work in a DetailsView with the intent to show the current value from a dataset, along with other additional values so that users can edit the data. In this example, this is a for State drop down. If my current state is DC, than I want DC to display with all other states following in the drop down. However, I cannot seem to get this to work without errors.
What this does is get the drop of state to select from, but I am unable to display the current value as default.
<asp:TemplateField HeaderText="State" SortExpression="">
<EditItemTemplate>
<asp:DropDownList ID="ddlState" runat="server" DataSourceID="dsState" DataTextField="Abbrv" DataValueField="Abbrv" AppendDataBoundItems = "true">
</asp:DropDownList>
<asp:SqlDataSource ID="dsState" runat="server" ConnectionString="<%$ ConnectionStrings:T2DKLR %>" SelectCommand="SELECT [StateID], [Abbrv] FROM [State] ORDER BY [Abbrv]"></asp:SqlDataSource>
</EditItemTemplate>
</asp:TemplateField>
Many thanks in advance for any insights.
January 15, 2022 at 9:10 pm
Thanks for posting your issue and hopefully someone will answer soon.
This is an automated bump to increase visibility of your question.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy