Click here to Skip to main content
15,916,945 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to remove duplicates from bounded dropdownlist with AppendDataBoundItems="true"?

thanks,
Posted
Comments
Richard C Bishop 5-Sep-13 12:24pm    
What is your data source look like?
[no name] 5-Sep-13 12:30pm    
access data source i used appenddatabounditem to add default item "Select One" where it can trigger the DropDownList1_SelectedIndexChanged()
Richard C Bishop 5-Sep-13 12:32pm    
You will need to filter the data in your data source before you populate the dropdownlist.
[no name] 5-Sep-13 12:50pm    
it duplicate the items in dropdownlist on databind
Richard C Bishop 5-Sep-13 12:50pm    
Show the code then, it does not do it by itself.

"on post back it databind again so it add the items another time"


Sounds like you just need a check in your Page_Load for IsPostback.
VB
 If IsPostBack Then
  'load your dropdown
End If
 
Share this answer
 
Create a dropdown method. If its not postback i.e. First Time Entry, then call the method.
 
Share this answer
 
Comments
[no name] 6-Sep-13 2:27am    
what do i write in that method

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900