By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,436 Members | 2,979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,436 IT Pros & Developers. It's quick & easy.

"choose one" in a dropdownlist

P: n/a
I have a databound drop down list. What is the easiest way to put the 1st
item as "choose one"?

Thanks.
Jun 27 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Jun 4, 4:47*pm, "Cirene" <cir...@nowhere.comwrote:
I have a databound drop down list. *What is the easiest way to put the 1st
item as "choose one"?

Thanks.
if u did not complete it yet.set the selectedindex property to the 1.
Jun 27 '08 #2

P: n/a
"Cirene" <ci****@nowhere.comwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
>I have a databound drop down list. What is the easiest way to put the 1st
item as "choose one"?
MyDDL.Items.Insert(0, new ListItem("Choose one", ""));
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #3

P: n/a
<asp:dropdownlist ... AppendDataBoundItems="true" ..>
<asp:ListItem Text="choose one" Value="-1" />
</asp:dropdownlist>

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Cirene" <ci****@nowhere.comwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
>I have a databound drop down list. What is the easiest way to put the 1st
item as "choose one"?

Thanks.

Jun 27 '08 #4

P: n/a
another possibility is in sql server, something like

select field01, field02 from tablename union '<< Chose One>>' as aa, -1 as
bb from tablename

and then .bind in codebehind etc.

John Bickmore
www.MyReader.net
"Cirene" <ci****@nowhere.comwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
>I have a databound drop down list. What is the easiest way to put the 1st
item as "choose one"?

Thanks.

Jun 27 '08 #5

P: n/a
thanks everyone !

all great advice!

"xzzy" <mr********@comcast.netwrote in message
news:BO******************************@comcast.com. ..
another possibility is in sql server, something like

select field01, field02 from tablename union '<< Chose One>>' as aa, -1 as
bb from tablename

and then .bind in codebehind etc.

John Bickmore
www.MyReader.net
"Cirene" <ci****@nowhere.comwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
>>I have a databound drop down list. What is the easiest way to put the 1st
item as "choose one"?

Thanks.


Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.