B
BSnow
I have a collection that inherits from NameObjectCollectionBase. Does anyone
know how to sort this type of collection.
I have tried the following code, but to no avail.
In my collection I have the following method.
Public Sub Sort()
Array.Sort(MyBase.BaseGetAllKeys, MyBase.BaseGetAllValues)
End Sub
In my object which populates the collection I have the following method.
Overridable Function CompareTo(ByVal obj As Object) As Integer Implements
IComparable.CompareTo
Return Name.ToString.CompareTo(CType(obj, R60Amount).Name)
End Function
Obviously it is not that simple.
know how to sort this type of collection.
I have tried the following code, but to no avail.
In my collection I have the following method.
Public Sub Sort()
Array.Sort(MyBase.BaseGetAllKeys, MyBase.BaseGetAllValues)
End Sub
In my object which populates the collection I have the following method.
Overridable Function CompareTo(ByVal obj As Object) As Integer Implements
IComparable.CompareTo
Return Name.ToString.CompareTo(CType(obj, R60Amount).Name)
End Function
Obviously it is not that simple.