Results 1 to 6 of 6

Thread: [RESOLVED] VB gets confused on Lisview sort! Help!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    Unhappy [RESOLVED] VB gets confused on Lisview sort! Help!

    Hey, I've never had trouble with this before, but here's the situation. In a listview control, my listitems are like "Aerosmith - Blind Man.mp3" , subitems(1) is the path "C:\MP3s", subitems(2) is a column titled "Artist", and subitems(3) is a column titled songname. The artist & songname fields are what the user sees in the listview. All other fields widths are set to 0. On the columnclick event you can sort your files by Artist OR Title. Problem is, VB gets confused here. After you sort by ascending & descending, the info gets mixed up somehow which doesn't make any sense to me! Basically what it does is when you sort by artist, it does just that, but ONLY by that. Since I'm sorting by a subitem of a listitem, it should resort the listitems as well to reflect the change but it doesn't. So I end up with something like this: listitem= ZZ Top - Tush.mp3 , Artist = AC DC, Songname= T.N.T. Why is it doing this?? Any help is EXTREMELY appreciated. here's my code below and the module I'm using to sort.
    VB Code:
    1. Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
    2. If ColumnHeader.Index = 3 Then
    3.     Call SortLvwOnString(ListView1, 3)
    4. End If
    5.  
    6. If ColumnHeader.Index = 4 Then
    7.     Call SortLvwOnString(ListView1, 4)
    8. End If
    9. End Sub
    Attached Files Attached Files
    Last edited by hipopony66; May 8th, 2002 at 09:12 PM.

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Instead of storing information in an "invisible" column, why not use the .Tag property?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    yes, but.......

    What does that have to do with my sorting problem?

  4. #4
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I never said it did.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    Talking OK Then!


  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Just think of it as a friendly bump to your post or something.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width