ListView Filter Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Simon98

ListView Filter  Topic is solved

01 Jun 2014, 16:02

Hi, I have a script with a listview and enabled functions like add, edit, delete, move row up and down etc. As number of rows can be big I thought to implement a filter - ListView would only show items which column would be the same as DropDownList selection.

What would be the best approach for doing this? I know I could destroy the listview and load the filtered data into the listview again but is there any other way? Also when user would make changes (add, edit, delete, move etc.) on the filtered listview, what would be the right way to always update the original one?

Thanks for any guidance or tips!
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: ListView Filter

04 Jun 2014, 08:57

You will have to "store" the data outside of the Listview. And load/show it in the listview with filtering the content (selective LV_Add). When the filter changes, you could remove the content of the listview and refill it (this would keep the order).

Or if the filter reduces the content you could go through the listview and delete the now filtered out items. Or when the filter increases the content, you could go through your "storage" and add the once that are not shown yet. But keeping the order of items will be complex, or you add at the end of the listview.

I usually disabled the redraw of the listview to speed up the operations and turned it back on when done. Depending of the size of data the cleaning and refill was mostly only a flickering of the screen, mainly because the content changed.

If you have free text edit fields for filter text. you might have to wait a grace period before the filter starts, otherwise you do the clean/refill after every keystroke. You should make sure that the user is done with specifying his filter. Or you add a "filter" button (adding one more step to the user interaction)
ciao
toralf
Simon98

Re: ListView Filter

07 Jun 2014, 05:22

Thank you Toralf for the tips. I see it will not be easy. :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: scriptor2016 and 336 guests