Collection was modified; enumeration operation may not execute.

8 posts, 1 answers
  1. Grant
    Grant avatar
    7 posts
    Member since:
    Oct 2009

    Posted 27 Oct 2009 Link to this post

    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
  2. Answer
    Jack
    Admin
    Jack avatar
    2333 posts

    Posted 28 Oct 2009 Link to this post

    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.
  3. Zach
    Zach avatar
    8 posts
    Member since:
    Feb 2008

    Posted 01 Dec 2009 Link to this post

    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
  4. Grant
    Grant avatar
    7 posts
    Member since:
    Oct 2009

    Posted 01 Dec 2009 Link to this post

    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...
  5. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 04 Dec 2009 Link to this post

    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.
  6. Grant
    Grant avatar
    7 posts
    Member since:
    Oct 2009

    Posted 17 Dec 2009 Link to this post

    Still haven't received the error. Seems like the upgrade was the fix for this issue. Thanks!
  7. Bahram Moinvaziri
    Bahram Moinvaziri avatar
    10 posts
    Member since:
    Oct 2008

    Posted 09 Feb 2010 Link to this post

    Removed my earlier question and posted it under a support ticket.
  8. Mark Reynolds
    Mark Reynolds avatar
    2 posts
    Member since:
    May 2010

    Posted 03 Apr 2013 Link to this post

    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;

     

Back to Top