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

SFAutoComplete custom renderer problem after update from 17.0.2.51 to 17.0.3.14

Hello,

I have SfAutoComplete custom Android renderer. 

[assembly: ExportRenderer(typeof(CustomSfAutoComplete), typeof(AutoComplete_Renderer))]

namespace TipCalculator.Droid.Renderers
{
    public class AutoComplete_Renderer : SfAutoCompleteRenderer
    {

        protected override void OnElementChanged(ElementChangedEventArgs<SfAutoComplete> e)
        {
            base.OnElementChanged(e);
            if (Control != null)
            {
                Control.GetAutoEditText().ImeOptions = Android.Views.InputMethods.ImeAction.Done;
                Control.InputType = Android.Text.InputTypes.TextFlagCapWords;
            }
        }

    }
}

it works fine in 17.0.2.51, but after update to 17.0.3.4 I had to add additional constructors:

        public AutoComplete_Renderer(Context context) : base(context)
        {
        }

        public AutoComplete_Renderer(Context context, IVisual visual) : base(context, visual)
        {
        }

but now it throws exception during page OnSizeAllocated

System.MissingMethodException: 'Constructor on type 'TipCalculator.Droid.Renderers.AutoComplete_Renderer' not found.'

Could you advise me a correct custom renderer code for the latest version?

Best regards,
Radek

3 Replies

Hemalatha Marikumar October 7, 2019 11:13 AM UTC

Hi Radoslaw,

Greetings from Syncfusion.
 
 
Query: Could you advise me a correct custom renderer code for the latest version? 
 
We glad to inform that Material UI design has been implemented for our Syncfusion control with latest version (Volume 3 2019 release). Hence we have updated the way to use the custom renderer of Syncfusion SfAutoComplete in below and also update the sample here

Sample Linkhttps://www.syncfusion.com/downloads/support/directtrac/general/ze/CustomRenderer-268199443

Code Snippet:
 
 
[assembly: ExportRenderer(typeof(CustomClass), typeof(CustomRendererAndroid))]

 
[assembly: ExportRenderer(typeof(CustomClass), typeof(MaterialSfAutoCompleteRenderer), new[] { typeof(VisualMarker.MaterialVisual) })] 
namespace CustomRenderer.Droid 
{ 
    public class CustomRendererAndroid : SfAutoCompleteRenderer 
    { 
        public CustomRendererAndroid(Context context) : base(context) 
        { 
        } 
 
        public CustomRendererAndroid(Context context, IVisual visual) : base(context, visual) 
        { 
        } 
 
        protected override void OnElementChanged(ElementChangedEventArgs<Syncfusion.SfAutoComplete.XForms.SfAutoComplete> e) 
        { 
            base.OnElementChanged(e); 
            if (Control != null) 
            { 
                Control.GetAutoEditText().ImeOptions = Android.Views.InputMethods.ImeAction.Done; 
                Control.InputType = Android.Text.InputTypes.TextFlagCapWords; 
            } 
        } 
    } 
 
    internal class MaterialSfAutoCompleteRenderer : SfAutoCompleteRenderer 
    { 
        public MaterialSfAutoCompleteRenderer(Context context) : base(context, VisualMarker.Material) 
        { 
        } 
    } 
} 
  
Please check with the sample and let us know if you have any concern.

Regards,
Hemalatha M.
 



RK Radoslaw Kubas October 8, 2019 03:34 PM UTC

Thank you for help, with your hint it works fine. :)




Hemalatha Marikumar October 9, 2019 09:10 AM UTC

Hi Radoslaw, 
 
Thanks for your update. 
 
We are glad to know that the given solution works.  
 
Please let us know if you need any further assistance. 
 
Regards, 
Hemalatha M. 


Loader.
Live Chat Icon For mobile
Up arrow icon