I'm populating a RadGridView with data that comes in asynchronously from a WCF service. The service sends blocks of records, say 200 at a time, which are then put into an ObservableCollection which is bound to the ItemsSource property of the grid. I would like to turn on Asynchronous loading of the data (DataLoadMode=Asynchronous), but when I do this, I get the following exception:
Collection was modified; enumeration operation may not execute.
This is with the Q2 2009 release of the WPF controls.
The datasource will be continually updated and changed as records are added and deleted to it.
Any ideas on how I can get this to work safely?
Thanks!
Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) |
at System.Collections.Generic.List`1.Enumerator.MoveNextRare() |
at System.Collections.Generic.List`1.Enumerator.MoveNext() |
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() |
at Telerik.Windows.Data.QueryableCollectionView.CreateInternalList() in c:\\Builds\\WPF_Scrum\\Core_WPF\\Sources\\Development\\Core\\Data\\Collections\\QueryableCollectionView.cs:line 423 |
at Telerik.Windows.Data.QueryableCollectionView.get_InternalList() in c:\\Builds\\WPF_Scrum\\Core_WPF\\Sources\\Development\\Core\\Data\\Collections\\QueryableCollectionView.cs:line 406 |
at Telerik.Windows.Data.QueryableCollectionView.GetEnumerator() in c:\\Builds\\WPF_Scrum\\Core_WPF\\Sources\\Development\\Core\\Data\\Collections\\QueryableCollectionView.cs:line 269 |
at Telerik.Windows.Data.RecordFactory.<CreateRecordsForGroupRecord>d__0.MoveNext() in c:\\Builds\\WPF_Scrum\\Core_WPF\\Sources\\Development\\Core\\Data\\Data\\Records\\RecordFactory.cs:line 28 |
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) |
at Telerik.Windows.Controls.GridView.GridViewDataControl.PopulateRecords() in c:\\Builds\\WPF_Scrum\\GridView_WPF\\Sources\\Development\\Controls\\GridView\\GridView\\GridView\\GridViewDataControl.cs:line 3178 |
at Telerik.Windows.Controls.GridView.GridViewDataControl.OnAsyncDataLoadWorkerDoWork(Object sender, DoWorkEventArgs e) in c:\\Builds\\WPF_Scrum\\GridView_WPF\\Sources\\Development\\Controls\\GridView\\GridView\\GridView\\GridViewDataControl.cs:line 3153 |
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)\r\n at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)" |
This is with the Q2 2009 release of the WPF controls.
The datasource will be continually updated and changed as records are added and deleted to it.
Any ideas on how I can get this to work safely?
Thanks!