从列表视图中删除索引未知的项目 [英] Remove item from listview with unknown index

查看:72
本文介绍了从列表视图中删除索引未知的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从具有选定索引的列表视图中删除一个项目.但它不接受.这是代码

up.Remove(usageProfileLists123.SelectedItem.ToString());

事实是,该列表的类型为usageprofile,它说:

i am trying to remove an item from a listview with the selected index. but it is not accepting it. this is the code

up.Remove(usageProfileLists123.SelectedItem.ToString());

the thing is that the list is of type usageprofile and it is saying :

Error   3   The best overloaded method match for 'System.Collections.Generic.List<SimulationFramework.Core.UsageProfiles.UsageProfile>.Remove(SimulationFramework.Core.UsageProfiles.UsageProfile)' has some invalid arguments  



我无法解决它.有帮助吗?



i cant get around it. any help?

推荐答案

ListView Remove函数将ListViewItem作为参数.删除.ToString(),然后重试
ListView Remove function takes ListViewItem as a parameter. Remove .ToString() and try again


这篇关于从列表视图中删除索引未知的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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