Blank top row in ListBox

M

Mark Aurit

Im populating a drop down list box from a database, and Id
like the top row to be blank - or be populated with the
words " select from entries below ", or something along
those lines.
I suppose I could do this at the database level, but it
seems it would be cleaner if I could populate the control
and before rendering it insert the line at the top. There
is a prerender event for the list box, but Im having a
difficult time with this, and I was hoping someone else
had some ideas.
Can anyone help?
Thanks, Mark
 
M

Mike Moore [MSFT]

Hi,

After you load your drop list with data, you can then insert a row at the
top as follows:
DropDownList1.Items.Insert(0, "Select one")

Does that answer your question?

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer’s security.

This posting is provided "AS IS", with no warranties, and confers no rights.


--------------------
 

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
474,079
Messages
2,570,573
Members
47,205
Latest member
ElwoodDurh

Latest Threads

Top