• Welcome to Valhalla Legends Archive.
 

Sorting VB6 ListViews

Started by KrAzY_NuK, March 21, 2006, 11:03 AM

Previous topic - Next topic

KrAzY_NuK

Hey all, Haven't been around in a while.

Quick question.  I've done some searching on google, and within this form, and haven't found an answer.

Using VB6, does anybody know if it's possible to sort a ListView by it's Tag property?

I know how to sort by any of the viewable columns, that's easy, but I can't seem to find any way to sort by tag.

Thanks,
Glenn

Grok

I have never heard of that being done.  Why do you think it is possible?  I could see creating a columnheader with the value from tag in it, but you already know you could do that.

RealityRipple

#2
Not very hard. Here's a link to an example:
http://realityripple.com/MyStuff/TagSortExample.zip

btw, the sorting method i used was a SelectionSort... I guess you could sort it using other methods, but Selections always seemed cleanest to me.

KrAzY_NuK

Grok:
I was just hoping it was possible.  Instead, I just added a hidden column.

RealityRipple:
Thanks for that, but I was hoping to use the built in VB stuff.  I'll check out your example later though.

topaz

I don't think there's an inherent function for it - instead, you could write a function that copies all the tags to an array and sort it from there.
RLY...?