Solved

First item in dropDownList blank

Posted on 2010-09-19
4
427 Views
Last Modified: 2012-06-27
Hi,

Usually when a DropDownlist is populated by items retrieved from a database the first item in the list shows in the List's textbox.

My Question is how to make that textbox blank, so that the items in the list only show when when we open it.

Thanks


0
Comment
Question by:adamtrask
4 Comments
 
LVL 21

Expert Comment

by:Dale Burrell
Comment Utility
You manually add a ListItem with blank text. You can add it in the HTML section<asp:ListItem> etc and then set the appenddataitems to true in the dropdownlist.
0
 
LVL 53

Expert Comment

by:Dhaest
Comment Utility
0
 
LVL 29

Accepted Solution

by:
Kumaraswamy R earned 500 total points
Comment Utility
Hi

After your databinding ,add fellow coding

dataListctrl.Items.Insert(0, new ListItem(String.Empty, String.Empty));
dataListctrl.SelectedIndex = 0;
0
 

Author Closing Comment

by:adamtrask
Comment Utility
Thanks a lot
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now