Connecting Tech Pros Worldwide Forums | Help | Site Map

binding a dropdown list C# .NET

Newbie
 
Join Date: Oct 2008
Posts: 2
#1: Oct 23 '08
I am using a databound dropdown list bound to a sql datasource in C# .NET environment. When the user opts to delete an entry from the dropdown list, the dropdown list does not reflect the change, even on postback.
i.e. ddlColors = red, yellow, blue, green; user selects to delete red; ddlColors = red, yellow, blue, green. Red is still displayed.
I am able to clear the dropdown list with ddlColors.ClearSelection(); But I don't know how to repopulate the dropdown list to display the updated datasource.

nateraaaa's Avatar
Expert
 
Join Date: May 2007
Location: Illinois
Posts: 663
#2: Oct 24 '08

re: binding a dropdown list C# .NET


After you remove the item from the drop down list are you calling dropdownlist.DataBind()?

Nathan
Newbie
 
Join Date: Oct 2008
Posts: 2
#3: Oct 30 '08

re: binding a dropdown list C# .NET


NM, i just manually added the new element. thks tho.
Reply