Results 1 to 3 of 3

Thread: sorting columns from listview

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Question

    Hi
    , Urgent
    Please, how I sorting the listview in the columns ?

    eg: I have

    hour_ini hou_fim room
    18:20 18:50 1
    18:50 19:20 1
    07:00 07:30 2
    07:30 08:00 2
    06:00 06:30 3
    Is sorted for room , I want sort for hour_ini, How do I ?
    07:00

  2. #2
    Addicted Member
    Join Date
    Mar 2000
    Posts
    168
    set the sorted value to true and the sort key to the column's index that you want.

    Thai

  3. #3
    Member
    Join Date
    Jan 1999
    Location
    Vancouver, BC, Canada
    Posts
    32
    Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)

    Static iLast As Integer
    Static iCur As Integer

    With ListView1
    .Sorted = True
    iCur = ColumnHeader.Index - 1
    If iCur = iLast Then .SortOrder = IIf(.SortOrder = 1, 0, 1)
    .SortKey = iCur
    iLast = iCur
    End With

    End Sub

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