473,383 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

VS 2005 Drop Down Lists

MC
Hi

Small problem, sure it easy.

I have a drop down list which i have wired to an SqlDataSource which is just
dragged and drop from toolbox.

Now it pulls the data easy enough, but i dont want to have any data
selected. Ideally I want the intial thing to say "-- Select a County --".

Now tried several things but non seem to affect the list.

Anyone know the code
MC
Nov 24 '05 #1
2 1420
You might be able to set the initial selectedindex to -1 and have a label
cover the text portion of the list box with text set to "Select a Country".
When the user drops down the box and selects a country, then make the
label.visible = False. Just an Idea. This is one of the disadvantages of
databinding with working with UI's.
--
Dennis in Houston
"MC" wrote:
Hi

Small problem, sure it easy.

I have a drop down list which i have wired to an SqlDataSource which is just
dragged and drop from toolbox.

Now it pulls the data easy enough, but i dont want to have any data
selected. Ideally I want the intial thing to say "-- Select a County --".

Now tried several things but non seem to affect the list.

Anyone know the code
MC

Nov 24 '05 #2
MC
Dennis

Thanks for the suggestion, I just figured it out.

Within the DropDownList Properties is "AppendDataBound" and is default to
False. Change this to true.

Then select "Items" from the Properties and add your field. Selected is also
a property of the Items Method.

Excellent. Jobs a good un

MC

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:42**********************************@microsof t.com...
You might be able to set the initial selectedindex to -1 and have a label
cover the text portion of the list box with text set to "Select a
Country".
When the user drops down the box and selects a country, then make the
label.visible = False. Just an Idea. This is one of the disadvantages of
databinding with working with UI's.
--
Dennis in Houston
"MC" wrote:
Hi

Small problem, sure it easy.

I have a drop down list which i have wired to an SqlDataSource which is
just
dragged and drop from toolbox.

Now it pulls the data easy enough, but i dont want to have any data
selected. Ideally I want the intial thing to say "-- Select a County --".

Now tried several things but non seem to affect the list.

Anyone know the code
MC

Nov 24 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Miguel Dias Moura | last post by:
Hello, i have an ASP.NET / VB page where i have a few 4 groups of Drop Down Lists. Each group of Drop Down Lists include 3 Drop Down Lists for date such as: DAY, MONTH, and YEAR. I don't want...
13
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
1
by: csgraham74 | last post by:
Hi Guys, I am currently building a web aplication in ASP.Net. On the onload event of a page a have a function to populate the many drop down lists on my page. I have one parameter table which...
7
by: Miguel Dias Moura | last post by:
Hello, i have an ASP.NET / VB page where i have a few 4 groups of Drop Down Lists. Each group of Drop Down Lists include 3 Drop Down Lists for date such as: DAY, MONTH, and YEAR. I don't want...
1
by: DCC700 | last post by:
After upgrading a web application from VS 2003 to 2005 there is a page where any control event that should cause a postback instead generates an Invalid character error on the page. For example a...
0
by: kajir | last post by:
Hi, I am new at using ASP.Net 2.0. I have various drop down lists on my master page. They refer to an SQL database. I also have a menu on the master page. I can select the values in the drop...
3
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the...
22
by: Archanak | last post by:
Hi, I am using 2-level CSS Drop Down Menu in my perl/CGI program. here is the code. #!c:/perl/bin/perl.exe use CGI qw(:standard);
3
by: jcassan | last post by:
Hello folks. I am new to these forums and have something, which has been stumping me for little while. I am using pspell to spellcheck a scrolling textbox (textarea) containing user input. I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.