We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfDataGrid Null Object Reference

Sometimes, when I scroll left and right using SfDataGrid, I get a Null Object Reference error. It seems to appear at random, and I can't find a way to replicate it.

Here's the stack trace :

Java.Lang.RuntimeException: Attempt to invoke virtual method 'android.content.ContentResolver android.content.Context.getContentResolver()' on a null object reference   at Java.Interop.JniEnvironment+InstanceMethods.CallBooleanMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <18d946a6778041c5bed1afeac1431a8f>:0    at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <18d946a6778041c5bed1afeac1431a8f>:0    at Android.Views.GestureDetector.OnTouchEvent (Android.Views.MotionEvent ev) [0x00031] in <86797e47c1604f7d8bd6ece722fe1cce>:0    at Syncfusion.SfDataGrid.XForms.Droid.GridCellBaseRenderer.OnTouchEvent (Android.Views.MotionEvent e) [0x00011] in <155db380372d4d8488029eb38a874e38>:0    at Syncfusion.SfDataGrid.XForms.Droid.GridCellRenderer.OnTouchEvent (Android.Views.MotionEvent e) [0x00000] in <155db380372d4d8488029eb38a874e38>:0    at Android.Views.View.n_OnTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00011] in <86797e47c1604f7d8bd6ece722fe1cce>:0    at (wrapper dynamic-method) System.Object.34(intptr,intptr,intptr)   --- End of managed Java.Lang.RuntimeException stack trace --- 

6 Replies

SP Subburaj Pandian Veluchamy Syncfusion Team March 27, 2019 10:37 AM UTC

Hi Maxence, 
Thank you for contacting Syncfusion support. 
Based on the provided information, we have checked the mentioned issue “Throws null exception when horizontally scrolling the DataGrid” Xamarin.Forms (Android) and we unable to replicate the issue from end, it is working fine as expected. We have prepared sample for the same, 
We have tested with Syncfusion update version and Xamarin.Forms version in the Samsung S7 device. 
Please check the sample and let us know if you still facing the same issue? If not, please modify the sample based on your scenario and revert us back with the following details, 
·       Device configuration details 
·       Issue reproducing video (if possible) 
·       Syncfusion and Xamarin.Forms update version 
It will be helpful for us to check on it and provide you the solution at the earliest.   
Subburaj Pandian V 

MR Maxence Roberge March 27, 2019 12:37 PM UTC

Yes, it seems to be fine for most users of our app, and only happens for a few. As for me, I cannot reproduce it on my device.

Thank you for your time, I will try to come back to you with the information you requested as soon as possible.

EM Emil March 27, 2019 11:14 PM UTC

in which syncfusion and xamarin version do you see this error?

SP Subburaj Pandian Veluchamy Syncfusion Team March 28, 2019 08:45 AM UTC

Hi Maxence, 
Thank you for the update. 
As we mentioned, please share the requested details (Sample, device details, Syncfusion and XF version) to replicate the issue at our end. We will wait until further response hear from you. 
Subburaj Pandian V  

MR Maxence Roberge March 28, 2019 01:40 PM UTC

Here's the sample modified. I've added another page because I think it could have something to do with the navigation. The crash could happen the first time someone scrolls the list after navigating to a page.

Also, our user is using a Honeywell CN75 running on Android 6.0, and here's our packages versions : 

Xamarin.Forms :
SyncFusion :
Xamarin.Android.Support :

Attachment: GridEditSample_4ae7c958.zip

PK Pradeep Kumar Balakrishnan Syncfusion Team March 30, 2019 06:43 AM UTC

Hi Maxence, 
Thank you for your update. 
We have checked the reported issue in shared sample in Samsung s8 and Samsung s6. But the crash is not replicated on our end. Is it possible for you to update the Syncfusion latest product version and Xamarin forms version if the issue occurs after updating to mentioned product version. Please revert us we will set up mentioned device environment and test the issue. 
Pradeep Kumar B 

Live Chat Icon For mobile
Up arrow icon