ArrayList Sort, InvalidOperationException

Hi, I sometimes get InvalidOperationException when sorting an arraylist object. Is there any reason why its happens sometimes. following is the stack trace of the error.

System.InvalidOperationException was unhandled
Message="InvalidOperationException"
StackTrace:
at SorterObjectArray.QuickSort()
at System.Array.Sort()
at System.Array.Sort()
at System.Collections.ArrayList.Sort()
at System.Collections.ArrayList.Sort()
at localize.Form1.computeposition()
at localize.Form1.proceed_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at localize.Program.Main()

any suggestions would be helpful.

Thanks you!!!




Answer this question

ArrayList Sort, InvalidOperationException

  • rKarthik

    where are you calling the sort method from Can we see your code please is there something else we should know also, such as what items are contained in the array list, and if it is running on a seperate thread etc....

  • ArrayList Sort, InvalidOperationException