ASP.NET Populating DropDownList based on RadioButtonList Selection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • frankiefrank
    New Member
    • Jan 2008
    • 15

    #1

    ASP.NET Populating DropDownList based on RadioButtonList Selection

    Hello,

    I have an aspx page with a RadioButtonList that has two Items, and a "ComboBox" (DropDownList) that I want to populate based on the selection in the RadioButtonList .

    The first RadioButtonList option is the default so I want to populate the dropdown list based on that in the beginning. Then every time the user clicks a radiobutton the dropdownlist items collection is cleared (in the SelectedIndexCh anged event) and then the appropriate items are added.

    No such luck - for some reason they dropdownlist contents doesn't change. If I populate the values in Page_Load (using ddl.Items.Add() ) these values are not changing. while debugging I can see that the Items.Count is changing, even see the values I've added but once the page is loaded I still only see the original values.

    By the way, the RadioButtonList has AutoPostBack set to true.

    Any advice?
Working...