Related Dropdown List Control

Last post 09-08-2003 12:49 AM by bottle. 5 replies.

Sort Posts:

  • Related Dropdown List Control

    07-03-2003, 11:43 AM
    • Member
      25 point Member
    • jameseb
    • Member since 08-08-2002, 11:31 AM
    • UK
    • Posts 5
    Hi Guys

    Could someone give me advise on how you program 3 related dropdown lists.

    I need to design a Country, Region, Resort DDL's

    My Example is If Someone Select USA from the Country DDL the Region DDL would be active and would display the US States then a State Like Florida was select the Resort DDl would now be active and would display Resorts Like Orlando etc.

    The data in each ddl is pulled from a db and each region has a foriegn key to the country table and resort the region table etc.

    Any Help (VB) would be useful.

    Thanks.

    James
    Jameseb


    .Net Developer


    .Net Rocks
  • Re: Related Dropdown List Control

    07-03-2003, 1:00 PM
    • Participant
      1,910 point Participant
    • Andy Smith
    • Member since 06-10-2002, 8:47 PM
    • Denver, CO
    • Posts 380
    • ASPInsiders
    check out my free ListLink control.
  • Re: Related Dropdown List Control

    07-03-2003, 1:10 PM
    • Contributor
      3,505 point Contributor
    • firoz.ansari
    • Member since 11-25-2002, 9:29 AM
    • Pune, India
    • Posts 694
    Hi,
    First you have to set AutoPostBack property of the all three dropdown to true
    Now first you have to fill the country dropdown from the database and two other dropdown blank. note that you have to bind country dropdown in condition when there is no postback

    There after when user select any country from the dropdown you have to fill region dropdown, in the SelectedIndexChanged event of the country dropdown.

    Same thing you have to do for the Resort drop down. fill the Resort dropdown in the SelectedIndexChanged event of the Region dropdown.

    I hope that you have got some idea about implementing three related dropdown.

    Regards
  • Re: Related Dropdown List Control

    09-07-2003, 10:26 PM
    • Member
      147 point Member
    • bottle
    • Member since 09-03-2003, 10:55 PM
    • Auckland
    • Posts 30
    Hi Andy. I know how to make 3 related drop down lists without a problem. However i'm interested to know how hard it is to make them dynamic without having a postback. IE - Using Javascript layers? I like how your example page using your ListLink control works - but want to code this myself if possible.

    Did you custom write Javascript to get this working, or does .NET having something inbuilt that i can look into further?

    Thanks!
    Akira Kurosawa
    "In a mad world only the mad are sane."
  • Re: Related Dropdown List Control

    09-07-2003, 11:00 PM
    • Participant
      1,910 point Participant
    • Andy Smith
    • Member since 06-10-2002, 8:47 PM
    • Denver, CO
    • Posts 380
    • ASPInsiders
    I provide the complete source code to my controls in the download. Download the control and to see everythign I do to create the effect.
  • Re: Related Dropdown List Control

    09-08-2003, 12:17 AM
    • Member
      147 point Member
    • bottle
    • Member since 09-03-2003, 10:55 PM
    • Auckland
    • Posts 30
    Sweet, thanks Andy. In the end i've implemented your control. No point in re-inventing the wheel. Besides, i'm VB - not C#. I'm sure i could look at the code and understand it, but time is money at the moment. =)

    I do have a quick question for you - is there an easy way for me to add a default option on one of my child dropdownlists? IE - at the top i'd want it to say "Please Select Your Model" and that way i could have it autopostback'ing once the user had selected the appropriate child dropdown.. ? At the moment i've got a "GO" button because i couldn't seem to get the default option stuck in there using normal means.

    Thanks!
    Akira Kurosawa
    "In a mad world only the mad are sane."
Page 1 of 1 (6 items)