views:

935

answers:

1

Hi all , I have listview with custom sort and filter implemented on it...It is textbox based filter , as user types in, items in the listview are filtered. Now...when i apply sort on listview, filter is very slow because each time custom sort compare method is called for each item in listview while filtering... how I can avoid compare method call of custom sort while filtering ?

A: 

You can sort the list before setting it into the ListView, it may be less convenient but I think that's the only way to avoid resorting when you change filter

Nir
I am sorting list before binding it to listview but user can change sorting anytime by clicking cloumn header of listview. Is there any way we can avoid call to ICompare method when we filter without resetting customsort property of view because it will sort again on resetting this property
Sandeep