Click here to Skip to main content
15,312,347 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two listbox say A and B binded with same datasource. If i select item from listbox A and i removed that item then it should also be removed from list box B.
Posted
Updated 2-May-13 2:40am
v2
Comments
joshrduncan2012 2-May-13 9:19am
   
What is your question?

1 solution

Hello,

Since both the select boxes are bound to the same data source you can write the client side javascript function similar to one shown below to delete the items.
JavaScript
function removeItem() {
    var s1 = document.getElementById('s1');
    var idx = s1.selectedIndex;
    if (s1 && idx > -1) {
        s1.remove(idx);
        var s2 = document.getElementById('s2');
        s2.remove(idx);
    }
}

Regards,
   

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