Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I doing Project in web application.I want to Combine two Dropdownlist selected Value and Display into Another Dropdownlist.Can anybody send me the Solution Please.......
Posted
Comments
[no name] 25-Oct-12 2:11am    
The answer is in the question itself :P .. what are you looking for ?
Sergey Alexandrovich Kryukov 25-Oct-12 2:19am    
What have you done so far?
--SA

C#
string one = ddl1.selectedvalue.tostring();
one = one + "-" + ddl2.selectedvalue.tostring();
ddl3.items.add(one);


is this what you looking for or you want to display union of items in ddl 3?
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 25-Oct-12 2:20am    
Ever heard that C# is case-sensitive?!
--SA
[no name] 25-Oct-12 2:31am    
hahaha...yes it is SA... i wrote this sample from my smartphone ... no visual studio there to compile n check. and i dont want to serve everything on OP plate... no spoon feeding.
Code given below may b the solution of your problem.

DropDownList3.Items.Add(DropDownList1.SelectedValue);
DropDownList3.Items.Add(DropDownList2.SelectedValue);
 
Share this answer
 

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