Hi
I have a user defined data type which implements IComparable interface
and has an implementation for the CompareTo method.
Public Class MyDataType Implements IComparable
--Private members
--Public properties
Public Function CompareTo(ByVal obj As Object) As Integer Implements
IComparable.CompareTo
End function
Public Property SortExpression() as String
End property
End Class
I create objects of this type and add it to a arrylist. Next I need to
sort the arraylist on any member of MyDataType. I set the shared
property SortExpression of MydataType to any member that I want to sort
and then call ArrayList.Sort. This works fine. But once I got this
error.
at System.SorterObjectArray.QuickSort(Int32 left, Int32 right)
at System.SorterObjectArray.QuickSort(Int32 left, Int32 right)
at System.Array.Sort(Array keys, Array items, Int32 index, Int32 length,
IComparer comparer)
at System.Collections.ArrayList.Sort(Int32 index, Int32 count, IComparer
comparer)
at System.Collections.ArrayList.Sort()
IComparer (or the IComparable methods it relies upon) did not return
zero when Array.Sort called x. CompareTo(x).
Any help is appreciated
Regards
RJN
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!