Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have:

ListView1,ListView2,ListView3

i want to get the text that is not on listview1 and listview2 and putted it on listview3.

pls help..


Listview1 items: apple, banana, mango
Listview2 items: apple, banana, mango, grapes, orange

i want to put grapes and orange to listview3


tnx
Posted

Use Linq
VB
lv3.Items.Add(lv2.Items.Except(lv1.Items).Union(lv1.Items.Except(lv2.Items)))
 
Share this answer
 
Take one by one items from Listview2.
Search it in ListView1.
If not found then add that item in Listview3.

What is the problem in this?
 
Share this answer
 
Comments
renc 4-Nov-11 9:21am    
sir 'Except' is not a member of 'System.Windows.Forms.ListView.ListViewItemCollection'
Maciej Los 7-Nov-11 3:39am    
This comment is for solution 1.

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