刪除一行時,我有一個Silverlight 4中(RIA 1.0),這是今天升級到Silverlight的5(RIA 1.0 SP2)錯誤Silverlight的5 DataGrid中
現在我得到當我試圖刪除下面的錯誤應用從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)
我有DomainContext.EntitySet裹成這勢必DataGrid中的ObservableCollection,所以當我試圖從的ObservableCollection刪除項目我得到這個錯誤。
此外,我試圖將EntitySet直接綁定到datagrid,並從EntitySet中刪除項目,我仍然得到相同的錯誤。
你會得到什麼異常信息?你給了我們一個堆棧跟蹤,但堆棧跟蹤頂部的例外(例如NullReferenceException,ArgumentException等)以及它包含的消息是什麼? –
我得到System.NullReferenceException:對象引用未設置爲對象的實例。 –