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

[Solved] Got error : Message: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.

8 Answers 403 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Saket S
Top achievements
Rank 1
Saket S asked on 04 Dec 2009, 11:25 AM
Hi ,

While grouping by some columns i will get Error: "System.InvalidOperationException: Collection was modified; enumeration operation may not execute."
So can you please help me...

Details error : 

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.2; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC EA 2)
Timestamp: Fri, 4 Dec 2009 09:29:15 UTC

Message: Unhandled Error in Silverlight Application
Code: 4004   
Category: ManagedRuntimeError      
Message: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.List`1.Enumerator.MoveNext()
   at System.Linq.Enumerable.<CastIterator>d__aa`1.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.Sum(IEnumerable`1 source)
   at System.Linq.Enumerable.Sum[TSource](IEnumerable`1 source, Func`2 selector)
   at Telerik.Windows.Data.GroupExtensions.LeavesCount(IEnumerable`1 groups)
   at Telerik.Windows.Data.QueryableCollectionView.get_ItemCount()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnCollectionViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.QueryableCollectionView.RefreshAndRaiseCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.QueryableCollectionView.Refresh()
   at Telerik.Windows.Data.QueryableCollectionView.EndDefer()
   at Telerik.Windows.Data.QueryableCollectionView.DeferHelper.Dispose()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PerformGrouping(String member, Object displayContent, Nullable`1 insertionIndex)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass2a.<GroupingRequested>b__29()
   at Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.GroupingRequested(Object origin, GroupingRequestedEventArgs e)    

Line: 67
Char: 13
Code: 0

 



Also can you tall me where should i get the Grouping Completed event.

Thanks In Advance....

S s.

8 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 04 Dec 2009, 12:44 PM
Hello,

Can you post more info how to reproduce this? More info about the grid version will be helpful as well.

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Saket S
Top achievements
Rank 1
answered on 04 Dec 2009, 02:47 PM
hi,

whenever i will drag my state column in to the Group By Header Zone then this will occures.
We are using the Q 3 lastest version ( 2009.2.0812.1030)

Thanks ..
S s

0
Vlad
Telerik team
answered on 04 Dec 2009, 02:50 PM
Hi,

Generally 2009.2.0812.1030 is Q2 SP1 not Q3. Can you reproduce the same on some of our online examples?

All the best,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Saket S
Top achievements
Rank 1
answered on 07 Dec 2009, 07:36 AM
hi,

your online examples are having the very less amount of data.
In my application we are having 20,000 records. Whenver i will drag some columns combinaton , it wil throw error.
Currently we are using the IE 8.0
So can you please help us out................

Regards,
S s.
0
Vlad
Telerik team
answered on 07 Dec 2009, 07:48 AM
Hello,

On this demo the grid is bound to 1mil. records. You may need also to check your scenario with latest Q3 version - this week we will publish also our official Q3 SP1.

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Saket S
Top achievements
Rank 1
answered on 07 Dec 2009, 08:50 AM
i am unable to to recreate the error on the demo example.

So is there any other way to communicate the error...

Regards,
S s
0
Saket S
Top achievements
Rank 1
answered on 07 Dec 2009, 03:16 PM
hi ,

In your demo, you have shown grouping on multiple columns but no aggregation specified.

As per my requirement i need to have Aggregation operation for each column (Sum / Avg / Count etc...). I applied the aggregation functions as per my requirements and displying at footer.

And in my implementation i am dealing with Entity classes where i am having nullable types. The Grouping working fine when i am grouping with one column. when i am going to group with second column, RAD gridview control is throwing error.

More over the information i am binding here is pure financial information and using required data formatters while presenting the data.

please suggest a solution.

0
Vlad
Telerik team
answered on 07 Dec 2009, 03:19 PM
Hi,

 Have you checked your scenario with our latest Q3 version?


Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Saket S
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Saket S
Top achievements
Rank 1
Share this question
or