Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have a dropdownlist which is populated from database now the task is I need to add dropdownlist with same the values except the value that is selected in the first dropdown how to do it?
Posted
Comments
bhagirathimfs 22-Aug-14 7:34am    
OnChange event of 1st dropdown write a code to create another dropdownlist.

Loop through all the option element of 1st dropdown except selected one.

1 solution

If you are using C#, then you can write similar LINQ query OnSelectionChanged/OnChange event of 1st dropdown.
Sample is shown below.
C#
string selectedValue = "Peeter";
 var emplst = from e in empList
 where e.Name != selectedValue
 select new { e.Name };


If you are using different language/framework...share sample code which you would be using, so that we can help better.

Thanks.
 
Share this answer
 
v2

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