This is a migrated thread and some comments may be shown as answers.

"Index was out of range" on .Clear()

4 Answers 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ivan
Top achievements
Rank 1
Ivan asked on 16 May 2012, 10:53 AM
Hello,

I'm blocking since several days with an error that freezes my Silverlight application.

The application is quite complexe, and it would be hard for me to provide any snippet of code... but I will try to be clear as possible :)

So, the problem is the following :

When I do a specific action in my application, I need to call this function in my process : MyList.Clear().

This MyList object is an ObservableCollection<MyObject>, and it is bound on a RadGrid.

Unfortunatelly, the Clear() function throws the following error :
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

That exception does not directly crash the application, but it is thrown a lot of time and finally slows it down in a way that it's freezed during a few seconds (a few that is too long for a user).

Note that I see this exception in the Console of Vistual Studio, or when the Debug option Break when exceptions cross AppDomain or managed/native boundaries is checked.

So I would appreciate any clue to avoid these freezes :)

Thanks a lot in advance.

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 16 May 2012, 11:25 AM
Hello,

 Can you post the grid version and the stack trace?

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Ivan
Top achievements
Rank 1
answered on 16 May 2012, 11:54 AM
Hello Vlad,

The version of the Grid is 2011.2.815.1040.

The stack trace is the following :


System.ArgumentOutOfRangeException crossed a native/managed boundary
  Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  StackTrace:
       à System.ThrowHelper.ThrowArgumentOutOfRangeException()
       à System.Collections.Generic.List`1.get_Item(Int32 index)
       à System.Collections.ObjectModel.Collection`1.get_Item(Int32 index)
  InnerException: 



Thanks for your support.
0
Vlad
Telerik team
answered on 16 May 2012, 02:18 PM
Hello,

 Can you try our current official version (Q1 2012 SP1) instead?

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Ivan
Top achievements
Rank 1
answered on 22 May 2012, 12:34 PM
Hello,

I just wanted to say that I had to put this problem on hold. I hope I'll have time to try and come back to you.

Thank you anyway.
Tags
GridView
Asked by
Ivan
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Ivan
Top achievements
Rank 1
Share this question
or