Solved

c# asp.net dropdownlist - how to have it so the first item is not visible

Posted on 2007-03-27
2
198 Views
Last Modified: 2010-04-16
simple question!

I have a number of dropdownLists with auto post back set to true.

dropdownlist 2 is dependent on the selection from dropdownlist 1 etc.....

how can I get it so that when each dropdownlist is populated the first item is not visible as I cannot select that item.  I have to select the second item and then re-select the first item before the next dropdownlist is populated.

I would like maybe for the dropdownlist to prompt the user or just appear blank before a selection is made

any idea guys?

0
Comment
Question by:jim_bob_jim
[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
2 Comments
 
LVL 35

Accepted Solution

by:
mrichmon earned 250 total points
ID: 18800674
You have to add a blank option to the dropdown list.

dropdownlistID.Items.Insert(0, new ListItem("", ""));
0
 

Author Comment

by:jim_bob_jim
ID: 18800739
thanks
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
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…

627 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