Populate .net dropdown

Discussion in 'ASP .Net' started by Poppy, Jan 15, 2004.

  1. Poppy

    Poppy Guest

    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
     
    Poppy, Jan 15, 2004
    #1
    1. Advertising

  2. Poppy

    Michael Guest

    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!

    "Poppy" <> wrote in message
    news:%...
    > 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
    >
    >
     
    Michael, Jan 15, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. André Almeida Maldonado

    Populate dropdown

    André Almeida Maldonado, Jan 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    389
    Hermit Dave
    Jan 14, 2004
  2. Mark Goldin

    Populate dropdown list

    Mark Goldin, Jul 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    516
    Jeffrey Palermo [MCP]
    Jul 26, 2004
  3. NDebt4Ever
    Replies:
    0
    Views:
    1,028
    NDebt4Ever
    Nov 11, 2010
  4. Steve Myers
    Replies:
    2
    Views:
    279
    Steve Myers
    Nov 20, 2003
  5. Enjoy Life
    Replies:
    2
    Views:
    280
    Roland Hall
    Feb 23, 2005
Loading...

Share This Page