tags:

views:

2695

answers:

2

C#: How to effectively filter (hide) ListView Items while in virtual mode?

I am looking for a way to filter (hide/show) items in ListView in Virtual Mode. I have my items cached in an array of listview items, how could I effectively make it so only specific listview items are displayed when pressing a filter-button, and then all of them back when pressing a not-filter button?

+2  A: 

You'll need to map your list of visible rows, so that when RetrieveVirtualItem requests an item, it requests into your filtered list that only contains visible items.

If you're using CacheVirtualItems to store ListViewItems, you'll need to update that cache when the filtering is applied, removing all non-visible rows. You may want to just clear the cache at that point to reduce complexity.

Robert Jeppesen
A: 

For this filter you data source from which you are creating item in RetrieveVirtualItem For more details please visit ListView In Virtual Mode Sorting

bimbim.in