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
1280
XamDataGrid issue in all versions after 2017.2, perhaps a bug
posted

Hi,

I've been encountering some issue with XamDataGrid on all versions after version 17.2.20172.2029.

Version 17.2.20172.20029 was the last working version, but unfortunately this version is missing some important features which has been developed afterwards.

Regarding the issue:

So far I have encountered i two scenarios:

1: When using empty XamDataGrid with AutoGenerated columns. Once the data source is changing  a mysterious NullReferenceException is thrown:

Exception thrown: 'System.NullReferenceException' in InfragisticsWPF4.DataPresenter.v18.2.dll
System.Windows.Data Error: 8 : Cannot save value from target back to source. BindingExpression:Path=SelectedTreeNode; DataItem='CTMViewModel' (HashCode=66898905); target element is 'TreeView' (Name=''); target property is 'SelectedItem' (type 'Object') NullReferenceException:'System.NullReferenceException: Object reference not set to an instance of an object.
   at Infragistics.Windows.DataPresenter.FieldLayout.IsListObjectCompatible(Object listObject, IEnumerable containingCollection, Boolean ignoreAutoGenerateFlag, PropertyDescriptorProvider pp, StringBuilder errorLog, Boolean assumeFieldMatch)
   at Infragistics.Windows.DataPresenter.RecordManager.OnSourceCollectionReset()
   at Infragistics.Windows.DataPresenter.RecordManager.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Infragistics.Windows.DataPresenter.RecordManager.ProcessChangeNotification(Object sender, Object eventArgs)
   at Infragistics.Windows.DataPresenter.RecordManager.OnChangeNotification(Object sender, Object eventArgs, Boolean isReset, Boolean isCellChangeNotification)
   at Infragistics.Windows.DataPresenter.RecordManager.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
   at System.Windows.WeakEventManager.ListenerList.DeliverEvent(Listener& listener, Object sender, EventArgs args, Type managerType)
   at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
   at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
   at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.ClearItems()
   at System.Collections.ObjectModel.Collection`1.Clear()
   at XamDataGridIssuePerhapsBug.ViewModels.CTM.CTMViewModel.set_SelectedTreeNode(Object value) in C:\Users\nn\Desktop\WorkSpaceVS\TestApplication\XamDataGridIssuePerhapsBug\ViewModels\CTM\CTMViewModel.cs:line 32'

Why is that a mysterious exception ?  Well it is thrown at ChildrenCollection.Clear() and as you can see on the above picture the collection is not null. And this exception is thrown for every second time the data source is changing. And regardless of which item you select. This exception as mentioned before does not happen i version 17.2.20172.2029.

This exception only occurres if the DataSource of XamDataGrid is set, if the datasource is not set rest of UI works fine and there is no Exception

Once the exception has occurred the grid start behaving strange with drawing items on top of each other and some items cannot be clicked.

2: This exception happens as well when the grid is loaded with the saved settings like filtering and layout.

I have attached an project with some sample data.

How to reproduce this issue. Simple expand a couple of the treeview items and click for instance on the first level, then on second level and on third level. Afterward clicking on any item will throw the exception for each second click.

XamDataGridIssuePerhapsBug.rar