Rami M. Nassar's Blog

Development, Beyound LifeStyle

HOW TO: Add a default ListItem to a DropDownList

This can be done one of 2 ways. A default ListItem can be added to a DropDownList programmatically with the following syntax after binding data to the DropDownList:

//Code here to populate DropDownList

DropDownListID.Items.Insert(0, new ListItem("Please Select One", "Default value")

 

This will add a ListItem to index 0, which will be the first ListItem.

In .NET 2.0, this can be done declaratively using the AppendDataBoundItems property. This will append all data-bound ListItems to the DropDownList, leaving those you add manually as the first selections.

<asp:DropDownList ID=DropDownListID AppendDataBoundItems=true runat=server>

<asp:ListItem Text=Please Select One Value=Default value />

</asp:DropDownList>

Comments

Jennifer said:

So-so. Something was not impressed.

# March 27, 2012 2:51 PM

Jennifer said:

So-so. Something was not impressed.

# March 27, 2012 2:51 PM

Rajashekaran said:

DropDownList1.Items.Insert(0, new ListItem("--Select--"));

# May 28, 2012 4:36 AM

icons design said:

<a href="www.large-icons.com/sitemap-008.htm"> I can recommend.</a>

# October 4, 2012 7:31 PM

icon package said:

<a href="www.plimus.com/.../buynow.jsp What nice message</a>

# October 8, 2012 2:36 PM

icon downloads said:

 I join. I agree with told all above.

<a href="windows2012icons.com/.../animated-cursor-window-7-c9">animated cursor window 7</a>

# October 31, 2012 11:57 AM

icon library said:

<a href=anihilacja.pl/showthread.php Bravo, your phrase simply excellent</a>

# November 1, 2012 3:51 AM

icons collection said:

[url=beelin.kiev.ua/showthread.php] Bravo, the excellent message[/url]

# November 4, 2012 8:19 AM

icon designs said:

[url=next2fun.com/.../viewtopic.php] Excellent variant[/url]

# November 4, 2012 9:14 AM

icon collection said:

[url=www.hdjd.bjedu.cn/comments.php] I consider, that you are not right. I can defend the position. Write to me in PM, we will discuss.[/url]

# November 4, 2012 3:13 PM

icon designs said:

[url=sellerservices.biz/.../viewtopic.php] I recommend to you to visit a site on which there are many articles on this question.[/url]

# November 4, 2012 4:02 PM

icon package said:

[url=www.computerworld.com.au/.../brisbane] Between us speaking, in my opinion, it is obvious. I recommend to look for the answer to your question in google.com[/url]

# November 5, 2012 10:35 AM

icons downloads said:

# November 5, 2012 11:50 AM

ipxioocnz.janjan.iun said:

By WebOsPublisher

--

HTTP Error 403

Error 403

We're sorry, but we could not fulfill your request for

/apple-icon-image-format.html on this server.

An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.

Your technical support key is: 58c6-c612-1756-6707

You can use this key to fix this problem yourself.

If you are unable to fix the problem yourself, please contact badbots at gmail.us and be sure to provide the technical support key shown above.

# December 8, 2012 8:07 PM

oinlineiconkaker.com said:

By WebOsPublisher

   JIDE Software - Preview Icon Set

                                                               Stock Icon Preview

                                                           Please flip through the pages to see a preview of all icons in each icon set. We grouped icons into different sections. Each page in the flash below is one section.

About Watermarking

                                                           Please note we added red

                                                               watermark to the preview icons in the Flash below and also

                                                               blurred the edge for copyright protection purpose. If you would like to see some of icons in the actual release, please email sales at jidesoft.com and ask for it.

                                                           VISTA ICON SET

                                                           Having trouble viewing the flash file above? You can also download

                                                               the VISTA Icon Set preview zip file.

                                                               VISTA ICON SET (NETWORK CATEGORY)

                                                           Having trouble viewing the flash file above? You can also download

                                                               the VISTA (NETWORK CATEGORY) Icon Set preview zip file.

                                                           MAC OS X ICON SET

                                                           Having trouble viewing the flash file above? You can also download

                                                               the Mac OS X Icon Set preview zip file.

                                                               MAC OS X ICON SET (NETWORK CATEGORY)

                                                           Having trouble viewing the flash file above? You can also download

                                                               the Mac OS X (NETWORK CATEGORY) Icon Set preview zip file.

                                                           XP ICON SET

                                                           Having trouble viewing the flash file above? You can also download

                                                               the XP Icon Set preview zip file.

# December 10, 2012 1:22 PM

download icons said:

P.S. Please review our <a href="http://it.glossyblog.info">design portfolio</a> for Doors2012.

# December 12, 2012 11:25 PM

Spurlock said:

Unquestionably consider that which you said.

Your favourite reason seemed to be at that the web the easiest factor to be mindful of.

I say to you, I certainly discover irked even as other folks consider worries they just don’t be

acquainted with about. You controlled to hit the nail upon that

the highest and defined out that the entire thing without having side-effects , people

could take a signal. Will probably be back to seek out more.

Thanks

# December 25, 2012 9:05 PM
Thanks for sharing your feedback! If your feedback doesn't appear right away, please be patient as it may take a few minutes to publish - or longer if the blogger is moderating comments.
Leave a Comment

(required) 

(required) 

(optional)

(required)