Custom Renderer Exception

2 posts, 0 answers
  1. Lama Chandrasena
    Lama Chandrasena avatar
    3 posts
    Member since:
    Jun 2010

    Posted 03 Jun 2015 Link to this post

    Hi,

    I am trying to build a Custom Renderer for the calendar control using http://docs.telerik.com/devtools/xamarin/controls/calendar/how-to/calendar-how-to-create-custom-renderer as a guide. Here is what I have:

     1. Custom calendar class:

    public class CustomCalendar : RadCalendar {
    }

    2. Custom calendar renderer class:

    [assembly: ExportRenderer(typeof(CustomCalendar), typeof(CustomCalendarRenderer))]
    namespace Proj1.Droid {
        public class CustomCalendarRenderer:  CalendarRenderer {
        protected override void OnElementChanged(ElementChangedEventArgs<RadCalendar> e) {
             base.OnElementChanged(e);
             this.Control.Adapter.SelectedCellTextColor = Android.Graphics.Color.Red;
             if (this.Control.EventAdapter.Events.Count > 0)

                this.Control.EventAdapter.Events[0].EventColor = Android.Graphics.Color.Yellow;

             }
       }
    }

     

    I have a break point on  base.OnElementChanged(e); and it causes an exception: java.lang.reflect.InvocationTargetException.

    Any ideas? Do you have a working example?

    Thanks.

  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 08 Jun 2015 Link to this post

    Hi,

    Indeed, this is a bug. Currently, you will be able to create a custom renderer if you use RadCalendar. The problem is already addressed and the fix will be included in our next release, expected by end of the week.

    Best regards,
    Ves
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top