Populate .net dropdown

P

Poppy

I have 2 tables. One is country and holds a list of countries and the other
is region which holds a list of states/provinces/countys relating to that
country.

How do I populate a combo so that it is indented.

e.g

USA
-Florida
-California
-Utah
Canada
-Ontario
-Quebec
England
-Kent
-Northumberland

TIA
 
M

Michael

You get real familiar with the dropdownlist.add() method, because this isn't
something you are going to acheive with the standard way of doing things.
First you have to design a query to return
countries/states/provinces/countys sorted by country, then you have to loop
through them, set some variable to the current country, and then pop either
a Country, or a state/province/county in the dropdownlist using the .add
method. If it is a state/province/county you'll probably need to add
something to the beginning to actually indent it. Then you'll have the
problem of finding out if they selected a country or a
state/province/county.

sounds fun!
 

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

Top