Hi I got next function:
The input ArrayList results is ordered correctly.
The return value returnList is completly unordered.
I think to problem is the HashTable isn't ordered correctly..
Is there a way I can order the Hashtable or should I sort the returnList on someway?
I want to order or sort on a field.
Private Function FilterDepartementenSurveys(ByVal results As ArrayList) As ArrayList
Dim hashTable As New Hashtable(results.Count)
For Each resultaat As DTO.Results.Reporting.FilledInSurvey In results
If Not hashTable.ContainsKey(resultaat.DepartmentCode) Then
hashTable.Add(resultaat.DepartmentCode, New ArrayList)
End If
Dim arraylist As ArrayList = CType(hashTable(resultaat.DepartmentCode), Collections.ArrayList)
arraylist.Add(resultaat)
Next
Dim returnList As New ArrayList
For Each list As ArrayList In hashTable.Values
returnList.Add(list)
Next
Return returnList
End Function