Question Sorted Lists

Clearshot

New member
Joined
Jun 15, 2010
Messages
2
Programming Experience
1-3
How can I sort data in a sorted list using values instead of keys from highest to lowest?

VB.NET:
Dim letterPercents As New SortedList()
letterPercents.Add("A", aCount / totalCount * 100)
letterPercents.Add("B", bCount / totalCount * 100)
letterPercents.Add("C", cCount / totalCount * 100)

Thanks.
 
You can't. The whole point of a SortedList is to sort by key. I would suggest creating your own type with two properties, then creating a List of that type. You can then sort that List any way you want.
 
Back
Top