SFDataGrid - System.NotSupportedException

I have the following error:

System.NotSupportedException: Unable to activate instance of type Com.Syncfusion.Numerictextbox.SfNumericTextBox from native handle 0x7980002d (key_handle 0x41dd9350). ---> System.MissingMethodException: No constructor found for Com.Syncfusion.Numerictextbox.SfNumericTextBox::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
10-13 19:11:17.003 I/MonoDroid(32392):    --- End of inner exception stack trace ---
10-13 19:11:17.003 I/MonoDroid(32392):   at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00054] in <9663139ab15947a89e15a6bcd9621f68>:0 
10-13 19:11:17.003 I/MonoDroid(32392):   at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00111] in <9663139ab15947a89e15a6bcd9621f68>:0 
10-13 19:11:17.003 I/MonoDroid(32392):    --- End of inner exception stack trace ---
10-13 19:11:17.003 I/MonoDroid(32392):   at (wrapper managed-to-native) Java.Interop.NativeMethods:java_interop_jnienv_call_void_method_a (intptr,intptr&,intptr,intptr,Java.Interop.JniArgumentValue*)
10-13 19:11:17.003 I/MonoDroid(32392):   at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00053] in <e499a5498b1b48379b88fe5ed629079f>:0 
10-13 19:11:17.003 I/MonoDroid(32392):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <e499a5498b1b48379b88fe5ed629079f>:0 
10-13 19:11:17.003 I/MonoDroid(32392):   at Android.Views.View.ClearFocus () [0x0000a] in <9663139ab15947a89e15a6bcd9621f68>:0 
10-13 19:11:17.003 I/MonoDroid(32392):   at Xamarin.Forms.Platform.Android.PlatformRenderer.DispatchTouchEvent (Android.Views.MotionEvent e) [0x0014f] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\PlatformRenderer.cs:64 
10-13 19:11:17.003 I/MonoDroid(32392):   at Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x0000f] in <9663139ab15947a89e15a6bcd9621f68>:0 
10-13 19:11:17.003 I/MonoDroid(32392):   at (wrapper dynamic-method) System.Object:a90d4b29-bdb8-43d7-978a-8192f2ffa972 (intptr,intptr,intptr)
10-13 19:11:17.033 W/dalvikvm(32392): JNI WARNING: JNI function NewString called with exception pending
10-13 19:11:17.033 W/dalvikvm(32392):              in Lmd51c42ee1c592fc184cfbb45ed4344a86a/SfNumericTextBox;.n_onFocusChanged:(ZILandroid/graphics/Rect;)V (NewString)
10-13 19:11:17.033 W/dalvikvm(32392): Pending exception is:
10-13 19:11:17.033 I/dalvikvm(32392): android.runtime.JavaProxyThrowable: System.NotSupportedException: Unable to activate instance of type Com.Syncfusion.Numerictextbox.SfNumericTextBox from native handle 0x7980002d (key_handle 0x41dd9350). ---> System.MissingMethodException: No constructor found for Com.Syncfusion.Numerictextbox.SfNumericTextBox::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
10-13 19:11:17.033 I/dalvikvm(32392):    --- End of inner exception stack trace ---


I use one Datagrid that contains a GridNumericColumn.

Regards



5 Replies

AN Ashok N Syncfusion Team October 16, 2017 10:31 AM UTC

Hi Andy,    
    
Thanks for contacting Syncfusion support.   
   
We have tested our SfDataGrid by adding GridNumericColumn and edited numeric values but we are not able to reproduced the issue in SfDataGrid v15.3.0.33. Given call stack shows the issue due to constructor missing but in our source, we have default constructor in all classes. For your reference we have attached sample in the below location, please check it. Could you please share more details regarding your issue whether you are facing the issue while using particular property in GridNumericColumn? Or while editing some values? Otherwise lease share your GridNumericColumn definition code snippet, also binding column Mapping name property type or please revert us by modifying our sample to replicate the issue or share your sample along with replication procedure, that would be more helpful for us to proceed further.   
Also, please share your Xamarin.Forms version and SfDataGrid product version?  
       
  
Regards,    
Ashok    



AL Andy Link October 16, 2017 02:07 PM UTC

Hi Ashok,

My error is happened when I execute the function EndEdit of the Datagrid.

I use the version 2.3.3.180 of Xamarin.Forms  and the version 15.3.0.26 of Syncfusion.

Please, check the attach file.

Regards,

Andy


Attachment: Test_a4e343c8.zip


AN Ashok N Syncfusion Team October 17, 2017 04:04 PM UTC

Hi Andy, 
 
We are sorry about the inconvenience caused. 
 
We have checked your sample and in your sample you have set the delay after SfDataGrid.EndEdit method call by handling SfNumericTextBox.ValueChanged event. So GridCell focus has been lost in value changed of SfNumericTextBox and calling SfDataGrid.EndEdit so application was crashed. You can achieve your requirement, be setting delay before calling SfDataGrid.EndEdit method. Please refer the below code example: 
 
private async void SfNumericTextBox_ValueChanged(object sender, ValueEventArgs e) 
{ 
    try 
    { 
        dataGrid.EndEdit(); 
        await Task.Delay(500); 
    } 
    catch (Exception) 
    { 
 
    } 
} 
 
Regards, 
Ashok 



AL Andy Link October 19, 2017 09:59 PM UTC

Thanks. It works.



AN Ashok N Syncfusion Team October 20, 2017 05:09 AM UTC

Hi Andy, 
 
Thanks for your update. Please let us know if you require further assistance on this. 
 
Regards, 
Ashok 
 


Loader.
Up arrow icon