If you want to get the key to the value, you can use SortedList.IndexOfValue(object value) to get the index of the value you specified. Then use SortedList.GetKey(int index) to return the key as an object from the value just collected.
Example
SortedList slLanguage = new SortedList(); //Initializes a new SortedList of name slLanguage //Add the keys and their values to the list slLanguage.Add("Bahasa", "id-ID"); slLanguage.Add("Chinese Simplified(中文简体)", "zh-CN"); slLanguage.Add("Chinese Traditional(中文繁體)", "zh-TW"); slLanguage.Add("Kazakh", "kk-KZ"); slLanguage.Add("Russian()", "ru-RU"); slLanguage.Add("Vietnamese(Việt)", "vi-VN"); slLanguage.Add("English", "en-US"); // object returnedKey = slLanguage.GetKey(slLanguage.IndexOfValue("zh-CN")); //Gets the key from zh-CN as returnedKey of type object
Thanks,
Hope you find this helpful :)
source share