The LoadLayout method of the RadGridView will sometimes throw an error "Collection was modified; enumeration operation may not execute." We have found that this happens after the following sequence of events:
1. Define one or more filters in the grid.
2. Use SaveLayout to save the layout definition, which includes the filters.
3. Use LoadLayout to load the layout that includes filters.
2. Use LoadLayout to load a different layout that includes no filters.
Apparently some internal code is iterating through the filter descriptors and attempting to delete them within the iteration. The workaround that we found is to first execute a .Columns.Clear() to remove all of the existing columns. Since they are all going to be replaced by the new layout this produces the same end result, minus the error.
We believe that this problem was introduced sometime between 2010Q1 and 2011Q1. Upgrading from 2010Q1 to 2011Q1 has been one of the most frustrating and time consuming version changes that I have ever experienced. There are a lot of new features and a lot of fixes, but it seems that little thought was given to backward compatibility.
1. Define one or more filters in the grid.
2. Use SaveLayout to save the layout definition, which includes the filters.
3. Use LoadLayout to load the layout that includes filters.
2. Use LoadLayout to load a different layout that includes no filters.
Apparently some internal code is iterating through the filter descriptors and attempting to delete them within the iteration. The workaround that we found is to first execute a .Columns.Clear() to remove all of the existing columns. Since they are all going to be replaced by the new layout this produces the same end result, minus the error.
We believe that this problem was introduced sometime between 2010Q1 and 2011Q1. Upgrading from 2010Q1 to 2011Q1 has been one of the most frustrating and time consuming version changes that I have ever experienced. There are a lot of new features and a lot of fixes, but it seems that little thought was given to backward compatibility.