What you want is easy.. and there definately is an Add() method.
With this you add an item which will end up in the bottom of the list:
DropDownList1.Items.Add("Select an item")
Wíth this you will insert an item in the top (index 0):
DropDownList1.Items.Insert(0,"Select an item")
OR...if you need to create an item that also has a value, since most Items
you have in a dropdownbox should return a value instead of a text.
DropDownList1.Items.Insert(0, New ListItem("Select an item", "VALUE"))
Questions?
Best regards/
Lars Netzel
"Jim Bancroft" <as******@nowhere.com> skrev i meddelandet
news:uM**************@TK2MSFTNGP14.phx.gbl...
Hi everyone,
I'm have a DropDownList that populates itself from a DataTable. Is
there some way to "append" additional rows after the datasource has been
attached? For example, I'd like to bind my DropDown, then add an extra
row for a default entry that'll appear no matter what data is retrieved.
I've looked around but didn't see an Add() method I could use. Is what
I'm asking possible, or is it the case you're out of luck after binding
your datasource? Thanks for the help.
-Jim