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.dllSystem.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
Hello Nawed,
Thank you for providing the sample application for the investigation.
I run the sample you provided as it is without making any changes , with the version 18.2.20182.186 (as this is been referenced in the sample) and not able to reproduce the issue.
I followed these steps (you provided):
1) Run the sample 2) expand a couple of the treeview items exm:00-09 first range item(your image)3) click on the first level, then on the second level and on the third level and on the fourth level4) try clicking on any item from any level example 1st level item
and I am not getting any exception or overlapping of the items.
Please let me know if I am missing something or if I need to modify sample in order to reproduce the issue.
Looking forward to hear you back.
Sincerely,Divya JainAssociate Software Developer
Hello Divya, thanks for the reply.
Where do you get version 18.2.20182.186 from ? When I download the latest version I get version 18.2.20182.137.
Perhaps this issue is solved in the latest release, but I have just tried it in all of the other versions from 17.2.20172.2029 to 18.2.2018.137 and I get the exception in all of them.
Ahh... I see... I have to run the updater instead of downloading... Will try with the new version and let you know
Even with the update I don't get that version.
Finally found it: