今日、Silverlight 5 (ria 1.0 sp2) にアップグレードされた Silverlight 4 (ria 1.0) アプリケーションがあります。
データグリッドからレコードを削除しようとすると、次のエラーが発生します。
System.Windows.Controls.DataGrid.OnRemovedElement (Int32 slotDeleted、オブジェクト itemDeleted、ブール値 isRow) で System.Windows.Controls.DataGrid.RemoveElementAt (Int32 スロット、オブジェクト項目、ブール値 isRow) で System.Windows.Controls.DataGrid.RemoveRowAt (Int32 rowIndex、オブジェクト項目) で System.Windows.Controls.DataGridDataConnection.NotifyingDataSource_CollectionChanged (オブジェクトの送信者、NotifyCollectionChangedEventArgs e) で System.Windows.Controls.DataGridDataConnection.<WireEvents>b__0 (DataGridDataConnection インスタンス、オブジェクト ソース、NotifyCollectionChangedEventArgs eventArgs) で System.Windows.Controls.WeakEventListener`3.OnEvent (TSource ソース、TEventArgs eventArgs) で System.Windows.Data.PagedCollectionView.OnCollectionChanged (NotifyCollectionChangedEventArgs args) で System.Windows.Data.PagedCollectionView.ProcessRemoveEvent で (オブジェクトの removedItem、ブール値の isReplace) System.Windows.Data.PagedCollectionView.ProcessCollectionChanged (NotifyCollectionChangedEventArgs args) で System.Windows.Data.PagedCollectionView.<.ctor>b__0 (オブジェクトの送信者、NotifyCollectionChangedEventArgs args) で System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged (NotifyCollectionChangedEventArgs e) で System.Collections.ObjectModel.ObservableCollection`1.RemoveItem (Int32 インデックス) で System.Collections.ObjectModel.Collection`1.Remove(T item) で Allscripts.UECPortal.Client.Modules.PayerpathEnrollmentProfile.ViewModels.CompleteUserInformation.CompleteUserInformationViewModel.deleteUserCommandExcuted (オブジェクト パラメーター) で Microsoft.Practices.Prism.Commands.DelegateCommand`1.<>c__DisplayClass6.<.ctor>b__2 (オブジェクト o) で Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute (オブジェクト パラメーター) で Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute (オブジェクト パラメーター) で System.Windows.Controls.Primitives.ButtonBase.ExecuteCommand() で System.Windows.Controls.Primitives.ButtonBase.OnClick() で System.Windows.Controls.Primitives.ToggleButton.OnClick() で System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp (MouseButtonEventArgs e) で System.Windows.Controls.Control.OnMouseLeftButtonUp (コントロール ctrl、EventArgs e) で MS.Internal.JoltHelper.FireEvent (IntPtr unmanagedObj、IntPtr unmanagedObjArgs、Int32 argsTypeIndex、Int32 actualArgsTypeIndex、文字列 eventName、UInt32 フラグ) で
DataGrid にバインドされている ObservableCollection に DomainContext.EntitySet をラップしているため、ObservableCollection からアイテムを削除しようとすると、このエラーが発生します。
また、EntitySet をデータグリッドに直接バインドし、EntitySet から項目を削除しようとしましたが、まだ同じエラーが発生しています。