Is there anything I can add to this line (or anywhere else) which will appear as the default option at the top of the list eg "---Select---"?
What's happening at the moment is that when the page loads, the first item from the drop down list in the mdb is being automatically used by the code above to return a whole bunch of records.
Member
47 Points
214 Posts
Default item at the top of a Drop Down List
May 17, 2019 11:58 AM|stabes|LINK
Hi all,
I have this code in a page which pulls drop down list items from a Access mdb:
<asp:DropDownList id="DropDownList1" runat="server" DataSourceID="AccessDataSource1" DataTextField="Category_1" DataValueField="Category_1" CssClass="TextBox">
</asp:DropDownList>
Is there anything I can add to this line (or anywhere else) which will appear as the default option at the top of the list eg "---Select---"?
What's happening at the moment is that when the page loads, the first item from the drop down list in the mdb is being automatically used by the code above to return a whole bunch of records.
Mart
Participant
1091 Points
673 Posts
Re: Default item at the top of a Drop Down List
May 17, 2019 12:08 PM|jzero|LINK
Set AppendDataBoundItens and add "Select" as ListItem
Member
47 Points
214 Posts
Re: Default item at the top of a Drop Down List
May 17, 2019 12:21 PM|stabes|LINK
Aha! Thanks. :-)