Click here to Skip to main content
15,898,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 :

VB
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?
Posted
Comments
BobJanova 1-Aug-11 10:43am    
The WinForms ListView doesn't have a SelectedItem property. What framework are you using? Are you binding the list control to a business layer list?

1 solution

ListView Remove function takes ListViewItem as a parameter. Remove .ToString() and try again
 
Share this answer
 

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