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
1215
Setting DataSource to Nothing / null
posted

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

Parents Reply Children