I made some changes to my wrapper module that I mentioned the other day. I had considered the sorting issues that Joe mentioned and added sorting routines similar to the code that he posted. The wrapper now has a sorting scheme that defaults to a regular cmp, but lets you pass in a sub to convert the data if you want. For an example, uncomment the code in the lv_ColumnClick event handler in my new test script: http://www.serbin.org/ariel/mms.zip
So far, this seems to be a pretty handy way to manage listviews for me. The think that I like about it is really easy to show the results of the query and the wrapper can return either the relevant ID or the underlying data. (see the mybutton_Click handler for an example.) In one app that I'm working on, I'd like to let the user decide which columns they would like to see in the listview. At first, I had planned to just write something to collapse unwanted columns to 0 width, but I think that using this module is much more intuitive. I also like the fact that the "rows" are not limited to what is shown in the listview. As always, thoughts are appreciated. -Ariel