Populate .net dropdown

  • Thread starter Thread starter Poppy
  • Start date Start date
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
 
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!
 
Back
Top