Solved

empty field in dropdown

Posted on 2006-06-27
2
188 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
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…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

785 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