I have an Silverlight 4 (ria 1.0) application which was upgraded today to Silverlight 5 (ria 1.0 sp2)
Now I am getting the following error when I am trying to delete record from datagrid:
at System.Windows.Controls.DataGrid.OnRemovedElement(Int32 slotDeleted, Object itemDeleted, Boolean isRow) at System.Windows.Controls.DataGrid.RemoveElementAt(Int32 slot, Object item, Boolean isRow) at System.Windows.Controls.DataGrid.RemoveRowAt(Int32 rowIndex, Object item) at System.Windows.Controls.DataGridDataConnection.NotifyingDataSource_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) at System.Windows.Controls.DataGridDataConnection.<WireEvents>b__0(DataGridDataConnection instance, Object source, NotifyCollectionChangedEventArgs eventArgs) at System.Windows.Controls.WeakEventListener`3.OnEvent(TSource source, TEventArgs eventArgs) at System.Windows.Data.PagedCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args) at System.Windows.Data.PagedCollectionView.ProcessRemoveEvent(Object removedItem, Boolean isReplace) at System.Windows.Data.PagedCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args) at System.Windows.Data.PagedCollectionView.<.ctor>b__0(Object sender, NotifyCollectionChangedEventArgs args) at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index) at System.Collections.ObjectModel.Collection`1.Remove(T item) at Allscripts.UECPortal.Client.Modules.PayerpathEnrollmentProfile.ViewModels.CompleteUserInformation.CompleteUserInformationViewModel.deleteUserCommandExcuted(Object parameter) at Microsoft.Practices.Prism.Commands.DelegateCommand`1.<>c__DisplayClass6.<.ctor>b__2(Object o) at Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter) at Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter) at System.Windows.Controls.Primitives.ButtonBase.ExecuteCommand() at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Primitives.ToggleButton.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)
I have DomainContext.EntitySet wrapped into ObservableCollection which is bound to datagrid, so when I am trying to delete item from ObservableCollection I am getting this error.
Also I have tried to bind EntitySet directly to datagrid, and remove item from EntitySet, I am still getting the same error.