How to Add new Item into DropDownList after DataBind with Database ?

K

Kylin

Now,the dropdownlist is binded with a DataSet object,
go on ,
I want to add a new item into DropDownList,
and let the new item in the first Postion,

like this:

-- All items -- //which I add
kjkljljljlk //which come from datset
jkjljl
jkjkljl
jkljljl
jkljasle

any help ?
 
T

TJS

example code:
.....
EventList.DataSource = dtrList
EventList.DataTextField = ("EventName")
EventList.DataValueField = ("EventID")
EventList.DataBind()

' insert an item at the beginning of the list
'----------------------------------------------------
Dim NewItem As ListItem
EventList.Items.Insert(0, New ListItem("-- All Events --","-1"))

......
 

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

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top