VS 2005 Drop Down Lists

  • Thread starter Thread starter MC
  • Start date Start date
M

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
 
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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top