How can I get the visible items from a winforms listview? There doesn’t seem to be a straightforward way, and I am reluctant to query items by control.clientrectangle or other hacks similar to the following:
https://stackoverflow.com/questions/372011/how-do-i-get-the-start-index-and-number-of-visible-items-in-a-listview)
When I say visible I mean the items are visible on the screen.
You can iterate from ListView.TopItem and check ListViewItem.Bounds property of each item whether it is located within the client area.
Better ListView Express is a freeware component that have also BottomItem property, so you can easily go through the visible items with a for loop (if both TopItem and BottomItem are not null):
You can try this – it have the same interface as ListView and have many improvements over .NET ListView.