获得差额投注. 2个listview项目并将差异与其他listview [英] Get the difference bet. 2 listview items and put the differece to other listview

查看:65
本文介绍了获得差额投注. 2个listview项目并将差异与其他listview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有:

ListView1,ListView2,ListView3

我想获取不在listview1和listview2上的文本,并将其放在listview3上.

请帮忙..


Listview1项:苹果,香蕉,芒果
Listview2项:苹果,香蕉,芒果,葡萄,橙子

我想把葡萄和橙子放到listview3


tnx

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

推荐答案

使用Linq
Use Linq
lv3.Items.Add(lv2.Items.Except(lv1.Items).Union(lv1.Items.Except(lv2.Items)))


从Listview2中逐一删除项目.
在ListView1中搜索.
如果找不到,则将其添加到Listview3中.

这是什么问题?
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?


这篇关于获得差额投注. 2个listview项目并将差异与其他listview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆