Hi All,
When I try to populate a dropdownlist control in C# in a web form during run time with
DropDownList1.Items.Add(new ListItem(somename, somevalue));
and create code in its SelectedIndexChanged event, the said event does not trigger. However, if I put ListItems in the dropdownlist control's items collection property during design time, its SelectedIndexChanged event fires. Am I doing something wrong when populating a dropdownlist control programmatically?
My workaround for this is I created a single item in the dropdownlist control's item collection properties during design time and then clear the dropdownlist's items during run time when I programmatically add items to it. Can I
not do this workaround? I might be missing something here.