After upgrading to the latest service release of 2011-2 I am now getting an exception when setting the DataSource to Nothing (in order to clear the grid). The exception raised is:
{System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Controls.Grids.XamPivotGrid.DataSourceChanged(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) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at Infragistics.Controls.Grids.XamPivotGrid.set_DataSource(IOlapViewModel value) at Cowi.Kompas.KompasClient.vmTable.UpdateDataSource(ObservableCollection`1 ds)}
The exception is only raised if DataSource has previously been set.
Is this a bug or feature? The exception was not thrown prior to the SR upgrade. If it is a feature, is there other preferred method to clear the data source and grid contents?
Mikael
Hi
I will look at it, but at first look i can say that we fixed similar issue. Is there anything unusual in setting data source to null. Like threads or something like this,
Todor
Hi,
I created a small sample using a flatdatasource. When I tested with the initial release of 2011.2 it did create an issue when the xamPivotGrid dataSource was set to null. The grid continued to show the data and when you clicked on an existing cell a null exception was raised.
After I updated to the latest service release the issue was resolved. Please try applying the latest service release.
Or if I haven’t described your issue, please give me more details so that I can investigate further.
The problem arised after upgrading to the SR.
The exception is thrown during the call to DataSource=Nothing. Prior to the SR this call itself did not throw an exception.
Anyway, we worked around it by enclosing the DataSource=Nothing statement in a try-catch block and calling it two times in a row. Not a big deal.
Thanks
I upgraded to 20112.2045. After I upgraded I had no issue with setting the DataSource to null or nothing after the data had been initially loaded.
Is that the version that you are using?
I hadn’t heard back from you. I understand that you implemented a work around but I was wondering if you had a chance to upgrade your application to 20112.2045. Or if you could identify which service release you are working with, it might be helpful to others who see this post.
Please let me know if I can help further.
As mentioned earlier, it was this upgrade that caused the problem in the first place. The work around is working and I haven't spent more time on this issue.