Welcome to the Xceed Community | Help
Community Search  
More Search Options

NullReferenceException in DataGrid 4.3

Sort Posts: Previous Next
  •  01-15-2012, 5:11 PM Post no. 31559

    NullReferenceException in DataGrid 4.3

    Hi Xceed,

    Since the version 4.3 of the DataGrid, a user reported me an NullReferenceException with the following stack trace.

    What do you think about that?

    Thanks

    Cyber Sinh

     

    Une exception de type 'System.NullReferenceException' a été levée :
    La référence d'objet n'est pas définie à une instance d'un objet.
    à Xceed.Wpf.DataGrid.CustomItemContainerGenerator.EnqueueContainer(DependencyObject container, Object item)
    à Xceed.Wpf.DataGrid.CustomItemContainerGenerator.RemoveContainer(DependencyObject container, Object dataItem)
    à Xceed.Wpf.DataGrid.CustomItemContainerGenerator.RemoveGeneratedItem(Int32 index, IList`1 removedContainers)
    à Xceed.Wpf.DataGrid.CustomItemContainerGenerator.RemoveGeneratedItems(Int32 startIndex, Int32 endIndex, IList`1 removedContainers)
    à Xceed.Wpf.DataGrid.CustomItemContainerGenerator.HandleSameLevelGroupRemove(GeneratorNode firstChild, Int32& countRemoved, Int32& genCountRemoved, Int32& removeIndex, NotifyCollectionChangedEventArgs e, IList`1 removedContainers)
    à Xceed.Wpf.DataGrid.CustomItemContainerGenerator.HandleParentGroupRemove(GeneratorNode parent, Int32& countRemoved, Int32& genCountRemoved, Int32& removeIndex, NotifyCollectionChangedEventArgs e, IList`1 removedContainers)
    à Xceed.Wpf.DataGrid.CustomItemContainerGenerator.OnGeneratorNodeGroupsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
    à Xceed.Wpf.DataGrid.NotifyCollectionChangedGeneratorNode.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
    à Xceed.Wpf.DataGrid.GeneratorNodeFactory.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
    à System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
    à System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
    à System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
    à System.Collections.ObjectModel.ReadOnlyObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
    à System.Collections.ObjectModel.ReadOnlyObservableCollection`1.HandleCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
    à System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
    à System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index)
    à System.Collections.ObjectModel.Collection`1.Remove(T item)
    à Xceed.Wpf.DataGrid.DataGridCollectionViewGroup.RemoveGroup(DataGridCollectionViewGroup group)
    à Xceed.Wpf.DataGrid.DataGridCollectionViewGroup.RemoveRawItemAt(Int32 index)
    à Xceed.Wpf.DataGrid.DataGridCollectionView.RemoveRawItemInGroup(IList`1 rawItems)
    à Xceed.Wpf.DataGrid.DataGridCollectionView.RemoveSourceItem(Int32 startIndex, Int32 count)
    à Xceed.Wpf.DataGrid.DataGridCollectionView.ExecuteSourceItemOperation(DeferredOperation deferredOperation, Boolean& refreshForced)
    à Xceed.Wpf.DataGrid.DeferredOperationManager.Process(Boolean processAll)
    à Xceed.Wpf.DataGrid.DataGridCollectionViewBase.DeferRefreshHelper.Dispose()
    // Items deletion

    Filed under:
  •  01-16-2012, 3:25 PM Post no. 31567 in reply to 31559

    Re: NullReferenceException in DataGrid 4.3

    We are also experiencing this exact same stack trace. It occurs when deleting the last child item of a group from the underlying data source through code manually.
  •  01-16-2012, 4:08 PM Post no. 31568 in reply to 31567

    Re: NullReferenceException in DataGrid 4.3

    Attachment: Release 4.3.12066.zip

    Hi,

    Thanks for bringing this to our attention. 

    The developer has made a quick fix for you to test, please find it attached. 

    Please let me know if this solves the issue on your side. 


    Best Regards,

    Michel Dahdah
    Technical Support
    Xceed Software inc.
  •  01-19-2012, 1:48 PM Post no. 31585 in reply to 31568

    Re: NullReferenceException in DataGrid 4.3

    Hi Michel,

     Thanks for the quick fix.

    I found an another exception while deleting items. Any help would be appreciated.

    Here is the stack trace:

    Une exception de type 'System.ArgumentOutOfRangeException' a été levée :
    startIndex must be equal to or greater than zero. Nombre del parámetro: startIndex

    en Xceed.Wpf.DataGrid.SelectionRange..ctor(Int32 startIndex, Int32 endIndex)
    en Xceed.Wpf.DataGrid.SelectedItemsStorage.OffsetIndex(Int32 startIndex, Int32 offset)
    en Xceed.Wpf.DataGrid.SelectionChanger.UpdateSelectedItemsInChangeOfDataGridContext(Boolean itemsSourceChanged)
    en Xceed.Wpf.DataGrid.SelectionManager.CommitSelectionChanger(SelectionChanger selectionChanger, Boolean itemsSourceChanged)
    en Xceed.Wpf.DataGrid.SelectionManager.End(Boolean itemsSourceChanged, Boolean allowCancelingOfSelection, Boolean allowSynchronizeSelectionWithCurrent)
    en Xceed.Wpf.DataGrid.SelectionManager.UpdateSelectionAfterSourceCollectionChanged(DataGridContext dataGridContext, NotifyCollectionChangedEventArgs e)
    en Xceed.Wpf.DataGrid.DataGridContext.Items_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
    en Xceed.Wpf.DataGrid.DataGridContext.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
    en System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
    en System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
    en System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
    en System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
    en System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
    en System.Windows.Controls.ItemCollection.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
    en System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
    en System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
    en System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
    en System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
    en Xceed.Wpf.DataGrid.DataGridCollectionViewBase.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
    en Xceed.Wpf.DataGrid.DataGridCollectionView.RemoveRawItemInGroup(IList`1 rawItems)
    en Xceed.Wpf.DataGrid.DataGridCollectionView.RemoveSourceItem(Int32 startIndex, Int32 count)
    en Xceed.Wpf.DataGrid.DataGridCollectionView.ExecuteSourceItemOperation(DeferredOperation deferredOperation, Boolean& refreshForced)
    en Xceed.Wpf.DataGrid.DeferredOperationManager.Process(Boolean processAll)
    en Xceed.Wpf.DataGrid.DataGridCollectionViewBase.DeferRefreshHelper.Dispose()
    // items deletion
     

  •  01-26-2012, 2:07 PM Post no. 31613 in reply to 31585

    Re: NullReferenceException in DataGrid 4.3

    Hi, 

    Please note that this has been fixed in the latest release which was released today.

    You can download it from the following link:

    http://xceed.com/Grid_WPF_Intro.html 


    Best Regards,

    Michel Dahdah
    Technical Support
    Xceed Software inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.