Click here to Skip to main content
15,867,895 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
hi to all,
Here i want to filter Value using multiselect dropdown

DESCRIPTION:-
1) Multiselect dropdown :-
Here i select any value (i.e) If i select single or multiple value ,that selected value should be filter in second dropdown.

2) Second (Normal Dropdown):-
I will display only selected value(multiple dropdown).no extra value should be selected.

For example:-
In Db:-
There are some many names(rahul,gokul,hari,nisha,vimal,john,sam)

For(1 st dropdown) multiple dropdown i select value(rahul,gokul,hari,vimal)
In (2 nd dropdown) only show (rahul,gokul,hari,vimal)not add extra value (nisha,john,sam).

kindly
Posted
Comments
Afzaal Ahmad Zeeshan 8-Nov-14 5:33am    
What is the problem? This is just an explaination of what you want to do.
JOTHI KUMAR Member 10918227 8-Nov-14 5:41am    
(In second dropdown)i want to dispaly only selected value in first dropdown(multiselect).
Afzaal Ahmad Zeeshan 8-Nov-14 5:49am    
You should've replied to my comment in order to notify me for a responce. Remember in future. :-)

1 solution

My dear friend, here you would need a Listbox or a combobox for multi select option, as you have mentioned. As from a dropdown selecting multiple values would be a complex.

If you need to select multiple values from a dropdown, then
onSelect method of the dropdown, you need to append the names selected in the same textbox separated by commas.

Once you get the values, suppose a user selects Raj,Simran,John. Take the textbox value using it's "id", once you get the value of the textbox that contains the values selected from the dropdown, split them using ".Split(',')". And then populate the second dropdown with each of the value you have got after separating them with the commas.

I hope you get the idea.
Post back your queries if any.
Thanks.
:)
 
Share this answer
 
Comments
JOTHI KUMAR Member 10918227 10-Nov-14 3:10am    
yeah i got it how to split with comma using linq query
JOTHI KUMAR Member 10918227 10-Nov-14 3:11am    
here i searched so many sites but still is in process
[no name] 10-Nov-14 3:13am    
Mate is your problem solved or you are stuck??
JOTHI KUMAR Member 10918227 10-Nov-14 5:02am    
i'm stuck in Linq query
JOTHI KUMAR Member 10918227 10-Nov-14 5:03am    
if you have any doubt see this is my second question to write linq query
http://www.codeproject.com/Questions/840624/how-to-separate-list-of-string-using-comma-in-linq

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