Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DropDownList control bug?
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
DropDownList control bug?
Miscellaneous
Thread ID:
01011165
Message ID:
01011165
Views:
60
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.
Reply
Map
View

Click here to load this message in the networking platform