Results 1 to 11 of 11

Thread: How to simple sort a ListView? (RESOLVED)

Threaded View

  1. #1

    Thread Starter
    Addicted Member AlvaroF1's Avatar
    Join Date
    Sep 2002
    Location
    SP - Brazil
    Posts
    200

    Question How to simple sort a ListView? (RESOLVED)

    I'd like to sort a ListView (View = Details) by the clicked column (ascending or descending).
    I was using this code to do it (VB6):

    VB Code:
    1. Private Sub ListView1_ColumnClick(ByVal ColumnHeader As ComctlLib.ColumnHeader)
    2.     With ListView1
    3.         If .SortKey <> ColumnHeader.Index - 1 Then
    4.             .SortKey = ColumnHeader.Index - 1
    5.             .SortOrder = 0
    6.         Else
    7.             If .SortOrder = 0 Then
    8.                 .SortOrder = 1
    9.             Else
    10.                 .SortOrder = 0
    11.             End If
    12.         End If
    13.     End With
    14. End Sub
    What about VB .NET?


    Thanks.
    Last edited by AlvaroF1; Aug 11th, 2003 at 02:38 PM.

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