Solved

First item in dropDownList blank

Posted on 2010-09-19
4
433 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
ID: 33713575
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
ID: 33714349
0
 
LVL 29

Accepted Solution

by:
Kumaraswamy R earned 500 total points
ID: 33714857
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
ID: 33716013
Thanks a lot
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

809 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