im trying to make the listview sort the listview items by column (whichever column was clicked, sort the list based on that column)

in vb6 it was done by:

Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
    Static olditem&
    With ListView1
        .SortKey = ColumnHeader.SubItemIndex
        If olditem = .SortKey Then .SortOrder = 1 - .SortOrder
        olditem = .SortKey
    End With
End Sub

can't figure out how to get it done in vb.net

Recommended Answers

All 2 Replies

i actually did read that earlier, it just seemed a little much just to sort the listview.

i'll give the datagridview a shot, see if i am able to use it.

thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.