Actually, if it is a HashTable, it cannot be sorted. On the other hand, if you have an ArrayList or any other collection that can be sorted, you can implement your own IComparer.
public class MyDicComparer : IComparer { public int Compare(Object x, Object y) { int Num1= ((Dictionary)x).Value; // or whatever int Num2= ((Dictionary)y).Value; if (Num1 < Num2) return 1; if (Nun1 > Num2) return -1; return 0; // Equals, must be consideres } ArrayList AL; ... AL.Sort(MyDicComparer);
NTN
Daniel Dolz
source share