Click here to Skip to main content
15,916,462 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
listview.items.count? is it a for loop?
Posted
Comments
joshrduncan2012 5-Dec-13 11:25am    
Great question for google.

It's the number of items in the Listbox.
The ListView.Items Property[^] is a .NET collection, and as such contains the Count property[^] to tell you how many there are at the current moment.

Yes, you can use it in a loop, but there are other things you might want to do with it as well.
 
Share this answer
 
For the datatable you can get the number of rows using:
dt.rows.count
And in the populated listview you could use
ListView.Items.Count

Ref to this:

http://www.dreamincode.net/forums/topic/269486-counting-the-rows-of-listview/[^]
 
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