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
565
BUG: Null reference exception after cancelling row exit and changing selection on another grid to update items source of original grid
posted

This is a bit complicated to explain, but the stack trace clearly shows the exception comes from within Infragistics code.

   at Infragistics.Controls.Grids.XamGrid.ExitCellFromEditModeInternalRow(Boolean cancel)
   at Infragistics.Controls.Grids.XamGrid.ExitEditModeInternal(Boolean cancel)
   at Infragistics.Controls.Grids.XamGrid.ExitEditMode(Boolean cancel)
   at Infragistics.Controls.Grids.RowsManager.InvalidateFiltering()
   at Infragistics.Controls.Grids.RowsManager.RowFiltersCollection_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Infragistics.Collections.CollectionBase`1.OnNotifyCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Infragistics.Collections.CollectionBase`1.OnResetItems()
   at Infragistics.Collections.CollectionBase`1.ResetItems()
   at Infragistics.RecordFilterCollection.ResetItems()
   at Infragistics.Controls.Grids.RowFiltersCollection.ResetItems()
   at Infragistics.Collections.CollectionBase`1.Clear()
   at Infragistics.Controls.Grids.RowsManager.OnItemsSourceChanged(Boolean invalidateSelectionAndActivation)
   at Infragistics.Controls.Grids.RowsManager.set_ItemsSource(IEnumerable value)
   at Infragistics.Controls.Grids.XamGrid.ApplyItemSource(IEnumerable itemSource)
   at Infragistics.Controls.Grids.XamGrid.ItemsSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Infragistics.Controls.Grids.XamGrid.set_ItemsSource(IEnumerable value)
   at EES.FD.Presentation.Web.Dashboard.CVRView.PTSensors._igridPTSensors_SelectedRowsCollectionChanged(Object sender, SelectionCollectionChangedEventArgs`1 e)
   at Infragistics.Controls.Grids.XamGrid.OnSelectedRowsCollectionChanged(SelectedRowsCollection previouslySelectedRows, SelectedRowsCollection newSelectedRows)
   at Infragistics.Controls.Grids.XamGrid.SelectRow(Row row, InvokeAction action)
   at Infragistics.Controls.Grids.XamGrid.SelectCell(Cell cell, InvokeAction action)
   at Infragistics.Controls.Grids.Cell.OnCellMouseDown(MouseEventArgs e)
   at Infragistics.Controls.Grids.XamGrid.XamWebGrid_MouseLeftButtonDown(Object sender, MouseButtonEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

 

From the fire event to the SelectedRowCollection, this is fired on grid B. The event assigns the ItemsSource from grid B to grid A and the exception occurs on grid A. This occurs when grid A's add new row is in edit mode.

 

Update: Basically, cannot set the ItemsSource property while the grid is in edit mode. I am preventing the row from exiting edit mode while not all values are filled in.