Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello colleges i hava method which returns a list and i want to bind this list to a listview control that i have added on my form.

foreach(Item item in m.AddItemToList(txtitemCode.Text))
{
listview1.additem(item)
}
but this code is not working as i cant get the add method of the listview
Posted

1 solution

this is how you add a item to a ListView

C#
foreach (var item in GetList(textBox1.Text))
           {
               //add item to the listview
               listView1.Items.Add(item);
           }
 
Share this answer
 
v4

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