Question: What changes need to be made to my code to allow me to sort more than once?
Information:
I have a list box that contains 1000 sample shipments in it in the program I'm currently writing, I've found the easiest way to sort these shipments at the click of a button is like so:
Private Sub Date_Ascending_Selected(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Date_Ascending.Selected
ShipmentsList.Items.SortDescriptions.Add(New SortDescription("ReceivedOn", ListSortDirection.Ascending))
End Sub
The problem with this is that it only works once. I have currently 4 of these (Date Asc and Des, Status Asc and Des) with potential for as many as 30. I would like to be able to sort more than once, but I'm not sure how to fix this. My gut tells me that the problem lies with the "New" part, but I don't know where else I should put it.