Now I can almost hear you think: "Why not switch key and value then?" Well, let’s say the key you would like to use is the username for a software program or a website. The value is the full name of the user. It is possible two different users have the same full name (John Smith), but have different usernames (j.smith and johns). In that case, switching keys and values won’t help you, because keys need to be unique in a SortedList.
To implement your own ‘sorted list’ which sorts based on the value, first create a class (or a struct) to hold the data for the key and the value you would like to retain in the list. Make sure you implement the IComparable interface, because you will need this to be able to sort the class/struct. For this example I implemented both key and value as a string:
public struct KeyValuePair : IComparable