This is a migrated thread and some comments may be shown as answers.

Custom Renderer Exception

1 Answer 70 Views
Calendar & Scheduling
This is a migrated thread and some comments may be shown as answers.
Lama Chandrasena
Top achievements
Rank 1
Lama Chandrasena asked on 03 Jun 2015, 07:38 PM

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.

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 08 Jun 2015, 10:45 AM
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
Tags
Calendar & Scheduling
Asked by
Lama Chandrasena
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or