SortedList就是按照key来排序的,如果你想按value来排序的话干脆把key=value来做好了,
但是Key的值是不允许重复的,也就是说如果value值有重复,那么排序后的结果中就只有一个该value值(重复的被去掉)对SortedList 初始化后,使用foreach遍历该SortedList 得到的自然是排好序后的结果SortedList mySortedList = new SortedList();    mySortedList["张三"]="我是张三";    mySortedList["李四"]="我是李四";    mySortedList["王五"]="我是王五";    mySortedList["赵六"]="我是赵六";    foreach (DictionaryEntry Item in mySortedList)      {        ListItem newListItem = new ListItem();        newListItem.Text = Item.Key.ToString();        newListItem.Value = Item.Value.ToString();        myDropDownList.Items.Add(newListItem);     
    }

解决方案 »

  1.   

    //做个类,继承IComparer,把Key和Value作为它的属性
    public class clsSort:IComparer
    {
    public string Key;
    public int Value; #region IComparer 成员 public int Compare(object x, object y)
    {
    // TODO:  添加 clsSort.Compare 实现
    clsSort objX=x as clsSort;
    clsSort objY=y as clsSort; if(objX.Value>objY.Value)
    return 1;
    if(objX.Value<objY.Value)
    return -1;
    return 0;
    } #endregion
    }//排序测试
    private void btnSortTest_Click(object sender, System.EventArgs e)
    {
    ArrayList arrList=new ArrayList(); clsSort cls=new clsSort();
    cls.Key="c";
    cls.Value=12;
    arrList.Add(cls); cls=new clsSort();
    cls.Key="b";
    cls.Value=23;
    arrList.Add(cls); cls=new clsSort();
    cls.Key="d";
    cls.Value=120;
    arrList.Add(cls); cls=new clsSort();
    cls.Key="g";
    cls.Value=2;
    arrList.Add(cls); cls=new clsSort();
    cls.Key="x";
    cls.Value=199;
    arrList.Add(cls);

    arrList.Sort(new clsSort()); for(int i=0;i<arrList.Count;i++)
    {
    clsSort obj=(clsSort)arrList[i];
    Console.WriteLine("Key={0},  Value={1}",obj.Key,obj.Value);
    }

    }
      

  2.   

    完全同意 longqiaoman(龙桥人)的方法
      

  3.   

    longqiaoman(龙桥人)的方法
    实现IComparer接口写一个比较类