Add item to top of a bound DropDownList

S

Steven K

Hello,

I have created a DropDownList that is bound to data from a stored procedure.
I also need to include a value at the top of the list ("Not In List"). I
can add an item to the bottom of the bound list with the following, but I
can't figure out how to add it to the top of the list.

Any help would be appreciated...

spBusUnit = cmdBusUnit.ExecuteReader()
ddlBusUnitBox.DataSource = spBusUnit
ddlBusUnitBox.DataTextField = "BusinessProduct_ID"
ddlBusUnitBox.DataTextField = "BusinessProduct_ID"
ddlBusUnitBox.DataBind()
spBusUnit.Close() : spBusUnit = Nothing
ddlBusUnitBox.Items.Add(New ListItem("Not In List","Not In List"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top