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

Collection was modified; enumeration operation may not execute.

7 Answers 466 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Grant
Top achievements
Rank 1
Grant asked on 27 Oct 2009, 12:46 PM
We have some users who are occasionally receiving the following error message. There's a few radio buttons on one of the screens in our application, and when the user clicks a radio button, it triggers a new datasource to load into the radgrid. Most of the time it works fine... I'm not sure from the error message what might be going wrong on occasion. Any insight is appreciated.

The version of Telerik.WinControls we're currently using is 8.2.0.0.


Collection was modified; enumeration operation may not execute.

at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()
at Telerik.WinControls.RadElementCollection.RadElementEnumerator.MoveNext()
at Telerik.WinControls.UI.GridRowElement.DisposeChildren(RadElementCollection children)
at Telerik.WinControls.UI.GridRowElement.Dispose(Boolean disposing)
at Telerik.WinControls.RadComponentElement.Dispose()
at Telerik.WinControls.RadElement.Cleanup()
at Telerik.WinControls.UI.GridTableBodyElement.CleanupRows()
at Telerik.WinControls.UI.GridTableElement.Update(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
at Telerik.WinControls.UI.GridViewTemplate.UpdateUI(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
at Telerik.WinControls.Data.DataAccessComponent.UpdateAll(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
at Telerik.WinControls.Data.DataAccessComponent.InitDataOnly()
at Telerik.WinControls.Data.DataAccessComponent.Bind(Object dataSource, String dataMember)
at Telerik.WinControls.Data.DataAccessComponent.set_DataSource(Object value)
at Telerik.WinControls.UI.RadGridView.set_DataSource(Object value)
at PARTS.ucMenuOrders.rdoOrderSelection_Click(Object sender, EventArgs e) in C:\sandbox\PARTSFinderSolution-4.0.0\PartsFinder\ucMenuOrders.cs:line 730

7 Answers, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 28 Oct 2009, 11:58 AM
Hello Grant Winney,

Thank you for contacting us. I was not able to reproduce this issue. This is an old version of RadControls and I suggest that you update it. The latest release is Q2 2009 SP1 (2.9.729). If you experience any troubles during the update, I will be glad to assist you. Should you have any other questions, please write us back.

Regards,
Jack
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
Zach
Top achievements
Rank 1
answered on 01 Dec 2009, 01:38 PM
Jack,
I am getting exactly the same behavior, using Q2 2009 SP1. It's not consistent at all so I can't reasonably reproduce it (I'm sorry!) Our users will operate for days without a problem, then for no apparent reason, it will happen. A user just reported it last night.
I've only seen it in our production environment, never with the debugger attached, so I can't offer any other information.

In my situation, I have a dialog box that pops up allowing the user to change some data. If the user makes changes and clicks OK, a grid's datasource on the 'parent' screen is reset. Then the same error with the same callstack as Grant occurs.

Running Q2 2009 SP1 on Windows XP Pro SP3
0
Grant
Top achievements
Rank 1
answered on 01 Dec 2009, 01:53 PM
We've since moved to build 2009.3.9.1103 in our production environment. So far (fingers crossed) we haven't received any more reports. But I figured I'd leave the ticket open for awhile just in case...
0
Jack
Telerik team
answered on 04 Dec 2009, 08:49 AM
Hi Grant,

I am glad to hear that. If you encounter this error again, please write us and we will research the issue.

Zash, please confirm whether the issue is still present in Q3 2009 SP1. We will be glad to help further.

All the best,
Jack
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
Grant
Top achievements
Rank 1
answered on 17 Dec 2009, 08:54 PM
Still haven't received the error. Seems like the upgrade was the fix for this issue. Thanks!
0
Bahram Moinvaziri
Top achievements
Rank 1
answered on 09 Feb 2010, 04:59 PM
Removed my earlier question and posted it under a support ticket.
0
Mark Reynolds
Top achievements
Rank 2
answered on 03 Apr 2013, 06:12 PM
I am experiencing the same problem.

I have a user editable check-column with filter. The name of the column is "include".

The intention is that the user can selectively identify rows to be included in the output. But when I attempt to programatically set or reset all of these records while the gridview filter is in place.

when I set the filter (checked or unchecked) and thereby impose a filter, I get the error when executing this code:

 

 

 

foreach (var childRow in radGridViewWells.ChildRows.Where(r => r.IsVisible))  
childRow.Cells["include"].Value = false;

 

Tags
GridView
Asked by
Grant
Top achievements
Rank 1
Answers by
Jack
Telerik team
Zach
Top achievements
Rank 1
Grant
Top achievements
Rank 1
Bahram Moinvaziri
Top achievements
Rank 1
Mark Reynolds
Top achievements
Rank 2
Share this question
or