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.
January 20, 2022 at 6:14 am
This was removed by the editor as SPAM
January 20, 2022 at 6:32 am
This was removed by the editor as SPAM
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply