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:
Private Sub resultsListView_ColumnClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnClickEventArgs) Handles resultsListView.ColumnClick Dim oldsort As SortOrder oldsort = resultsListView.Sorting If resultsListView.Sorting = SortOrder.Ascending Then resultsListView.Sorting = SortOrder.Descending ElseIf resultsListView.Sorting = SortOrder.Descending Then resultsListView.Sorting = SortOrder.Ascending Else : resultsListView.Sorting = SortOrder.Ascending End If 'resultsListView. Me.Refresh() 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




Reply With Quote