System.NullReferenceException in UnWireDataGridEvents()

Hi,

after upgrading from 19.1.0.69 to 19.2.0.44 I'm getting NullReferenceException when loading grid data. It happens only in some cases in my app, so far I couldn't isolate it and create reproducible sample for you. Don't you have an idea what was changed there what could cause it?

Stack trace:

at Syncfusion.UI.Xaml.Grid.SfDataGrid.UnWireDataGridEvents()

at Syncfusion.UI.Xaml.Grid.SfDataGrid.UnWireEvents()

at Syncfusion.UI.Xaml.Grid.SfDataGrid.OnItemsSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)

at Syncfusion.UI.Xaml.Grid.GridPropertyMetadata.OnDependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)

at Syncfusion.UI.Xaml.Grid.GridPropertyMetadata.OnInternalDependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)

at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)

at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)

at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)

at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)

at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)

at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)

at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)

at System.Windows.Data.BindingExpression.Activate(Object item)

at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)

at System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance)

at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)

at MS.Internal.Data.DataBindEngine.Run(Object arg)

at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()

at System.Windows.ContextLayoutManager.UpdateLayout()

at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)

at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()

at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)

at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)


Thanks

Ondřej


6 Replies

VS Vijayarasan Sivanandham Syncfusion Team July 15, 2021 01:56 PM UTC

Hi Ondrej Svoboda,

Thank you for contacting Syncfusion Support.

We have fixed the issue “
Null reference exception occurs while binding non initialized selectedItems property in SfDataGrid when ItemSource binding at runtime” and you can download the patch from following location.

v19.2.0.44
 
Recommended approach – exe will perform automatic configuration       
Please find the patch setup here:   

 

Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment                       
 
Please find the patch assemblies alone from: 

 
Please find the NuGet’s from the below location: 

 
 
  
Assembly Version: 19.2.0.44 
Installation Directions:  
This patch should replace the files “Syncfusion.SfGrid.WPF” under the following folder.  
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.0  
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\19.2.0.44\precompiledassemblies\19.2.0.44\4.0  
   
To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location, or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.  
 
Note:  
To change how you receive bug fixes, ask your license management portal admin to change your project’s patch delivery mode.  
   
   
Disclaimer:  
If you have received other patches for the same version for other products, please apply all patches in the order received. Please note that we have created this patch for version 19.2.0.44 specifically to resolve the following issue reported in the forum 167238.  
 
Regards, 
Vijayarasan S 



OS Ondrej Svoboda July 16, 2021 08:47 AM UTC

Hi,

thanks, I'll wait till it is released in weekly nuget package. Will it be there next week?



VS Vijayarasan Sivanandham Syncfusion Team July 16, 2021 12:42 PM UTC

Hi Ondrej Svoboda, 

Thanks for the update. 

We have created bug report for the reported issue “Null reference exception occurs while binding non initialized selectedItems property in SfDataGrid when ItemSource binding at runtime”. We will fix this issue and include in our July 27th ,2021 NuGet release.  

You can track the status of this report through the following feedback link, 

Feedback link:  https://www.syncfusion.com/feedback/27052/null-reference-exception-occurs-while-binding-non-initialized-selecteditems
 
Note: The provided feedback link is private, and you need to login to view this feedback. 

We appreciate your patience until then. 

Regards, 
Vijayarasan S 



VS Vijayarasan Sivanandham Syncfusion Team July 27, 2021 05:53 AM UTC

Hi Ondrej Svoboda,

Thank you for your patience.

We are glad to announce that our latest weekly NuGet package update version 19.2.0.49 has been is rolled out with the “Null reference exception occurs while binding non initialized selectedItems property in SfDataGrid when ItemSource binding at runtime” and is available for download.
 

Please let us know, if you require further assistance on this.

Regards,
Vijayarasan S
 



OS Ondrej Svoboda July 27, 2021 09:10 AM UTC

Works OK, thanks.



VS Vijayarasan Sivanandham Syncfusion Team July 27, 2021 10:31 AM UTC

Hi Ondrej Svoboda,

Thanks for the update.

We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊.

Regards,
Vijayarasan S

Loader.
Up arrow icon