This question is locked. New answers and comments are not allowed.
Hi,
I need to select/deselect items from one listbox to another.
For that I am using two radlistboxes, both are having same items. Both listbox's selectionmode="Multiple".
When user selects items in first list, I need to select them in second listbox through Javascript.
For that, I tried some code, but it works for single item only.
At present I am using it on "OnClientSelectedIndexChanging" event.
What should I do to work it for multiple items too?
I need to select/deselect items from one listbox to another.
For that I am using two radlistboxes, both are having same items. Both listbox's selectionmode="Multiple".
When user selects items in first list, I need to select them in second listbox through Javascript.
For that, I tried some code, but it works for single item only.
| var ctl1= $find('<%= lstTestcategory2.Clientid %>'); |
| var ctl= $find('<%= lstTestcategory.Clientid %>'); |
| for(var i = 0; i<= ctl.get_items().get_count()-1; i++) |
| { |
| var item1 = ctl.get_items().getItem(i); |
| alert(item1.get_text()); |
| alert(item1.get_selected()); |
| check = 1; |
| for(var i = 0; i<= ctl1.get_items().get_count()-1; i++) |
| { |
| // alert('in'); |
| var item = ctl1.get_items().getItem(i); |
| if(item.get_text() == e.get_item().get_text()) |
| { |
| // alert('in1'); |
| item.set_selected(true); |
| check = 1; |
| } |
| else |
| { |
| item.set_selected(false); |
| } |
| } |
At present I am using it on "OnClientSelectedIndexChanging" event.
What should I do to work it for multiple items too?