467,915 Members | 1,826 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

"choose one" in a dropdownlist

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
  • viewed: 1078
Share:
5 Replies
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
"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
<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
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
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.

Similar topics

6 posts views Thread by chris yoker via DotNetMonster.com | last post: by
1 post views Thread by chris yoker via DotNetMonster.com | last post: by
reply views Thread by guido_brasletti | last post: by
1 post views Thread by =?Utf-8?B?TWFyayBIb2xsYW5kZXI=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.