SyncGridCellNumericRenderer not working in 16.1.0.37

Hi, 

I use the version 16.1.0.37. 

I use the specific renderer to change the keyboard for a SfEntry which contains a double value.

[assembly: ExportRenderer(typeof(SfEntry), typeof(SyncGridCellNumericRenderer))]
namespace Android.Controls.Renderer
{
    public class SyncGridCellNumericRenderer : EntryRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
        {
            base.OnElementChanged(e);
            if (e.OldElement == null)
            {
                var value = e.NewElement.Text;
                if (!string.IsNullOrEmpty(value))
                {
                    double valeur = 0;
                    if (double.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out valeur))
                    {
                        this.Control.KeyListener = new CustomNumericKeyListener();
                    }
                }
                var nativeEditText = (global::Android.Widget.EditText)Control;
                nativeEditText.SetSelectAllOnFocus(true);
            }
        }
    }
}


On previous version, it works very well. 
Now the class is never called.

I try to use the new renderer (GridCellTextViewRenderer), but i can't specify a keyboard.

I don't use GridNumericColumn becase when I entered a '.' (dot) nothing happened and when I entered a ',' (comma) 
I have an exception

new GridNumericColumn(){
AllowNullValue = true,
CultureInfo = new System.Globalization.CultureInfo("fr-FR"),
NumberDecimalDigits = 2,
NumberDecimalSeparator = ","
}

08-08 16:55:20.027 I/MonoDroid( 7649): UNHANDLED EXCEPTION:
08-08 16:55:20.112 I/MonoDroid( 7649): System.FormatException: Input string was not in a correct format.
08-08 16:55:20.112 I/MonoDroid( 7649):   at System.Number.ParseDouble (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) [0x0008f] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
08-08 16:55:20.112 I/MonoDroid( 7649):   at System.Double.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00000] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
08-08 16:55:20.112 I/MonoDroid( 7649):   at System.Double.Parse (System.String s, System.IFormatProvider provider) [0x0000c] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
08-08 16:55:20.112 I/MonoDroid( 7649):   at System.Convert.ToDouble (System.String value) [0x00013] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
08-08 16:55:20.112 I/MonoDroid( 7649):   at Com.Syncfusion.Numerictextbox.SfNumericTextBox.set_Value (System.Object value) [0x00195] in <d1716a7936334e77970abdca6e54fff0>:0 
08-08 16:55:20.112 I/MonoDroid( 7649):   at Com.Syncfusion.Numerictextbox.SfNumericTextBox.SetTextAndValue (System.String formattedValue, System.Object intermediateValue) [0x001a4] in <d1716a7936334e77970abdca6e54fff0>:0 
08-08 16:55:20.112 I/MonoDroid( 7649):   at Com.Syncfusion.Numerictextbox.SfNumericTextBox.GetTextChange (System.Object s) [0x004ff] in <d1716a7936334e77970abdca6e54fff0>:0 
08-08 16:55:20.112 I/MonoDroid( 7649):   at Com.Syncfusion.Numerictextbox.SfNumericTextBox.OnTextChanged (Java.Lang.ICharSequence text, System.Int32 start, System.Int32 lengthBefore, System.Int32 lengthAfter) [0x002e0] in <d1716a7936334e77970abdca6e54fff0>:0 
08-08 16:55:20.112 I/MonoDroid( 7649):   at Android.Widget.TextView.n_OnTextChanged_Ljava_lang_CharSequence_III (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_text, System.Int32 start, System.Int32 lengthBefore, System.Int32 lengthAfter) [0x0000f] in <263adecfa58f4c449f1ff56156d886fd>:0 
08-08 16:55:20.112 I/MonoDroid( 7649):   at (wrapper dynamic-method) System.Object.8a390756-f068-44ab-a77d-b0461c2088c2(intptr,intptr,intptr,int,int,int)
08-08 16:55:20.137 E/MobileCenterCrashes( 7649): Unhandled Exception:
08-08 16:55:20.137 E/MobileCenterCrashes( 7649): System.FormatException: Input string was not in a correct format.
08-08 16:55:20.137 E/MobileCenterCrashes( 7649):   at System.Number.ParseDouble (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) [0x0008f] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
08-08 16:55:20.137 E/MobileCenterCrashes( 7649):   at System.Double.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00000] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
08-08 16:55:20.137 E/MobileCenterCrashes( 7649):   at System.Double.Parse (System.String s, System.IFormatProvider provider) [0x0000c] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
08-08 16:55:20.137 E/MobileCenterCrashes( 7649):   at System.Convert.ToDouble (System.String value) [0x00013] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
08-08 16:55:20.137 E/MobileCenterCrashes( 7649):   at Com.Syncfusion.Numerictextbox.SfNumericTextBox.set_Value (System.Object value) [0x00195] in <d1716a7936334e77970abdca6e54fff0>:0 
08-08 16:55:20.137 E/MobileCenterCrashes( 7649):   at Com.Syncfusion.Numerictextbox.SfNumericTextBox.SetTextAndValue (System.String formattedValue, System.Object intermediateValue) [0x001a4] in <d1716a7936334e77970abdca6e54fff0>:0 
08-08 16:55:20.137 E/MobileCenterCrashes( 7649):   at Com.Syncfusion.Numerictextbox.SfNumericTextBox.GetTextChange (System.Object s) [0x004ff] in <d1716a7936334e77970abdca6e54fff0>:0 
08-08 16:55:20.137 E/MobileCenterCrashes( 7649):   at Com.Syncfusion.Numerictextbox.SfNumericTextBox.OnTextChanged (Java.Lang.ICharSequence text, System.Int32 start, System.Int32 lengthBefore, System.Int32 lengthAfter) [0x002e0] in <d1716a7936334e77970abdca6e54fff0>:0 
....
An unhandled exception occured.


What can I do to specify the keyboard? 

Thanks





4 Replies

VR Vigneshkumar Ramasamy Syncfusion Team August 14, 2018 06:15 PM UTC

Hi Vincent,  
  
Sorry for the inconvenienced caused.   
  
We have analyzed the reported query for SyncGridCellNumericRenderer is not working in 16.1.0.37. We have prepared a sample for the reported query to validate the same from our side and we have checked in the 16.2.0.32 version where also the SyncGridCellNumericRenderer is does not calls in the sample. We have attached the tested sample and you can download from the following link.  
  
  
Please modify the attached sample to reproduce the reported issue from your side which will be helpful for us to validate and provide you the solution at earlier.  
  
Regards,  
Vigneshkumar R 



DE DEV August 21, 2018 10:27 AM UTC

Thanks. 

With the last version, I don't have the previous exception and it works. 

But I use the specific code to EndEdit the cell when the key 'Enter' is pressed : 

private async void DataGrid_CurrentCellBeginEdit(object sender, GridCurrentCellBeginEditEventArgs e)
        {
            {
                await Task.Delay(100);
                if (((column as IElement).Element as ContentView).Content is SfNumericTextBox)
                {
                    var c = ((column as IElement).Element as ContentView).Content as SfNumericTextBox;
                    c.ValueChangeMode = ValueChangeMode.OnLostFocus;
                    c.ValueChanged += Entry_Completed;
                 }
             }
}

private async void Entry_Completed(object sender, EventArgs e)
        {
            try
            {
                dataGrid.EndEdit();
}
            catch (Exception x)
            {}
}

In the catch I have the following exception : 

System.NullReferenceException: Object reference not set to an instance of an object.
  at Syncfusion.SfDataGrid.XForms.GridEditingController.EndEdit (System.Boolean canCommit, System.Boolean cancelEdit) [0x0031c] in <a03bd74b78e84dd4875c47258a289b57>:0 
  at Syncfusion.SfDataGrid.XForms.SfDataGrid.EndEdit () [0x00006] in <a03bd74b78e84dd4875c47258a289b57>:0 
  at Views.Views.Saisie.Saisie+<Entry_Completed>d__7.MoveNext () [0x00024] in  


And after I have this uncatched exception. 

Unhandled Exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Com.Syncfusion.Numerictextbox.SfNumericTextBox'.

What is the solution? 
Come back to GridTextColumn? 


AA Arulraj A Syncfusion Team August 24, 2018 12:38 PM UTC

Hi Vincent, 
 
Sorry for the inconvenience caused. 
 
We are able to reproduce the reported issue for “Calling EndEdit when edit view is unfocused crashes the application”. We will fix this issue and it will included in the 2018 Volume 3 release which is scheduled to rolled out at the end of september. We appreciate your patience until then 
 
Regards, 
Arulraj A 



VR Vigneshkumar Ramasamy Syncfusion Team September 24, 2018 07:09 AM UTC

Hi Vincent, 
 
We are glad to announce that our Essential Studio Volume 3, 2018 release (v16.3.0.21) is rolled out and is available for download under the following link. 
 
 
The mentioned issue with “Calling EndEdit when edit view is unfocused crashes the application “ issue has been fixed and included in this release. 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Vigneshkumar R 


Loader.
Up arrow icon