Hi Guys,

I'm trying to set something up where the user can sort each column by clicking on the header... i've looked at some other examples and they seem pretty longwinded.. just wondering the best way to do this..

so far i have the below...

VB Code:
  1. Private Sub resultsListView_ColumnClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnClickEventArgs) Handles resultsListView.ColumnClick
  2.         Dim oldsort As SortOrder
  3.         oldsort = resultsListView.Sorting
  4.         If resultsListView.Sorting = SortOrder.Ascending Then
  5.             resultsListView.Sorting = SortOrder.Descending
  6.         ElseIf resultsListView.Sorting = SortOrder.Descending Then
  7.             resultsListView.Sorting = SortOrder.Ascending
  8.         Else : resultsListView.Sorting = SortOrder.Ascending
  9.         End If
  10.         'resultsListView.
  11.         Me.Refresh()
  12.  
  13.     End Sub

which works fine... but only for the first column in the list view.

Is there a way of specifying which column to sort based on which is clicked?

Dan