Solved

empty field in dropdown

Posted on 2006-06-27
2
192 Views
Last Modified: 2010-04-16
Hi guys,

need to know how I create an empty or 'Please select' entry in a drop down list that is populated from a dataset.

I have the following, but it does not seem to work

dd.Items.Add("Please select");
dd.DataSource = dataset;
dd.DataTextField = "Code";
dd.DataValueField =   "Value";
dd.DataBind();

Cheers

Wayne
0
Comment
Question by:watherton
[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
 

Accepted Solution

by:
laurens76 earned 50 total points
ID: 16991212
I solved this by putting the following line after the dd.DataBind():

dd.Items.Insert(0, "Please select");
0
 

Author Comment

by:watherton
ID: 16991233
great stuff lauren
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
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…
Suggested Courses

630 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