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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SFAutoComplete custom renderer problem after update from 17.0.2.51 to 17.0.3.14

Thread ID:

Created:

Updated:

Platform:

Replies:

148100 Oct 5,2019 03:52 PM UTC Oct 9,2019 09:10 AM UTC Xamarin.Forms 3
loading
Tags: SfAutoComplete
Radoslaw Kubas
Asked On October 5, 2019 03:52 PM UTC

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

Hemalatha Marikumar [Syncfusion]
Replied On 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.
 


Radoslaw Kubas
Replied On October 8, 2019 03:34 PM UTC

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



Hemalatha Marikumar [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon