• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 450
  • Last Modified:

First item in dropDownList blank

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
adamtrask
Asked:
adamtrask
1 Solution
 
Dale BurrellCommented:
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
 
Kumaraswamy RCommented:
Hi

After your databinding ,add fellow coding

dataListctrl.Items.Insert(0, new ListItem(String.Empty, String.Empty));
dataListctrl.SelectedIndex = 0;
0
 
adamtraskAuthor Commented:
Thanks a lot
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now