before doing the data binding from the data base do dropdownlist.items.add("Include All Categories"). The databind my clear out any items already added if that is the case you might be better off looping through the data. So you would need to do dropdownlist.items.add("Include
All Categories") followed by a loop that adds each item from the DB. So rather than databinding you might have to read from the DB.
dotnetdev201...
Member
319 Points
79 Posts
Re: How to add one additional option to the start of a databound dropdown list?
Apr 30, 2012 05:42 PM|LINK
before doing the data binding from the data base do dropdownlist.items.add("Include All Categories"). The databind my clear out any items already added if that is the case you might be better off looping through the data. So you would need to do dropdownlist.items.add("Include All Categories") followed by a loop that adds each item from the DB. So rather than databinding you might have to read from the DB.
do while dbReader.read
dropdownlist.items.add(dbReader.getValue(i)
i += 1
loop