Solved

First item in dropDownList blank

Posted on 2010-09-19
4
445 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

719 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