DropDownList AppendDataBoundItems problem

Discussion in 'ASP .Net Web Controls' started by Kursat, Jun 5, 2007.

  1. Kursat

    Kursat Guest

    Hi,

    I built a master detail structure with two DropDownLists, one for Countries
    (master) and one for Cities (detail). I used SqlDataSource parameters to
    built the relation.Users select a country from Countries list and see cities
    of that country in the Cities list. I also add "All Cities" static item to
    the Cities list and set AppendDataBoundItems property to true so that this
    static line appears on top of the list. So far so good but if a user selects
    two or more countries repeatedly all cities of selected countries are being
    appended to the list. I want only "All Cities" static line and cities of
    selected country to be listed.

    Is it possible to do so other than manually filling the Cities DropDownList?

    Thanks in advance.
     
    Kursat, Jun 5, 2007
    #1
    1. Advertising

  2. did you made it?

    did you made it? It have to be a way to do it without hard code. Please write to me if you made it.

    EggHeadCafe.com - .NET Developer Portal of Choice
    http://www.eggheadcafe.com
     
    Daniel Rodriguez, Jun 12, 2007
    #2
    1. Advertising

  3. this works...

    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
    DropDownList2.Items.Clear()
    DropDownList2.Items.Insert(0, "Seleccione aqui")
    End Sub

    EggHeadCafe.com - .NET Developer Portal of Choice
    http://www.eggheadcafe.com
     
    Daniel Rodriguez, Jun 12, 2007
    #3
    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. mr2_93
    Replies:
    1
    Views:
    3,603
    mr2_93
    Oct 2, 2005
  2. tshad
    Replies:
    8
    Views:
    2,236
    tshad
    Oct 19, 2005
  3. =?Utf-8?B?TWF0dEJlbGw=?=

    Using AppendDataBoundItems in extended controls

    =?Utf-8?B?TWF0dEJlbGw=?=, May 9, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    444
    =?Utf-8?B?TWF0dEJlbGw=?=
    May 9, 2006
  4. David C

    AppendDataBoundItems giving dups

    David C, Jun 25, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,384
    David C
    Jun 25, 2007
  5. AppendDataBoundItems

    , Aug 9, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    351
Loading...

Share This Page