Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1675
XamGrid - Cannot change ObservableCollection during a CollectionChanged event
posted

I am using XamGrid which is bounded to collectionviewsource, apparently when i add filter row to the xamgrid (via below xaml) i get the exception "cannot change observablecollection during a collectionchanged event" i.e. when the first row is added to the collection, it seems the gridmanager is initializing the rowfilter when the first row is added. 

Appreciate if you could shed some light why i might be getting this exception or how i can avoid it? 

I am using the latest service release

<ig:XamGrid x:Name="grid" Grid.Row="1">
<ig:XamGrid.FilteringSettings>
<ig:FilteringSettings AllowFiltering="FilterRowTop" FilteringScope="ColumnLayout">
</ig:FilteringSettings>
</ig:XamGrid.FilteringSettings>
</ig:XamGrid>

at System.Collections.ObjectModel.ObservableCollection`1.CheckReentrancy()
at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
at System.Collections.ObjectModel.Collection`1.System.Collections.IList.Add(Object value)
at System.Windows.Data.ListCollectionView.AddNewCommon(Object newItem)
at Infragistics.DataManagerBase.GenerateNewObject()
at Infragistics.Controls.Grids.RowsManager.GenerateNewObject(RowType rowType)
at Infragistics.Controls.Grids.RowsManager.ResetFilterRows(Boolean generateNewData)
at Infragistics.Controls.Grids.RowsManager.InitializeData()
at Infragistics.Controls.Grids.RowsManager.ItemsSource_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at System.Windows.Data.ListCollectionView.ProcessCollectionChangedWithAdjustedIndex(NotifyCollectionChangedEventArgs args, Int32 adjustedOldIndex, Int32 adjustedNewIndex)
at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)

at ... <I add value to the underlying collection here>

Parents Reply Children