Thank you for the responses. So i'm still having issues with the custom renderer. My end goal of this is to have all of the rest of the functionality of the calendar stay the same, but be able to just change the styling of Today and Selected Date cells. When i try to implement your example I'm getting a key not found exception. I implemented it as follows:
01.
using
System;
02.
using
System;
03.
using
System.Collections.Generic;
04.
using
System.Linq;
05.
using
Telerik.XamarinForms.Common;
06.
using
Telerik.XamarinForms.Input;
07.
08.
namespace
Mobile_Release_POC_4
09.
{
10.
public
class
CustomCalendar: RadCalendar
11.
{
12.
public
CustomCalendar():
base
()
13.
{
14.
15.
}
16.
17.
18.
}
19.
}
In my android project:
01.
using
System;
02.
using
Mobile_Release_POC_4.Droid;
03.
using
Telerik.XamarinForms.Input;
04.
using
Telerik.XamarinForms.InputRenderer.Android;
05.
using
Xamarin.Forms;
06.
using
Xamarin.Forms.Platform.Android;
07.
using
Com.Telerik.Widget.Calendar;
08.
09.
[assembly: ExportRenderer(
typeof
(Mobile_Release_POC_4.CustomCalendar),
typeof
(CustomCalendarRenderer))]
10.
namespace
Mobile_Release_POC_4.Droid
11.
{
12.
public
class
CustomCalendarRenderer: CalendarRenderer
13.
{
14.
protected
override
void
OnElementChanged(ElementChangedEventArgs<RadCalendar> e)
15.
{
16.
base
.OnElementChanged(e);
17.
this
.Control.Adapter.TodayCellBackgroundColor = ColorExtensions.ToAndroid(Color.Red);
18.
this
.Control.Adapter.TodayCellBorderColor = ColorExtensions.ToAndroid(Color.Yellow);
19.
this
.Control.Adapter.SelectedCellBackgroundColor = ColorExtensions.ToAndroid(Color.Green);
20.
this
.Control.CellDecorationsLayer.StrokeWidth = 5;
21.
this
.Control.CellDecorationsLayer.Color = ColorExtensions.ToAndroid(Color.Blue);
22.
}
23.
24.
}
25.
}
This generates an exception.
I also took a look at this forum post:http://www.telerik.com/forums/override-renderer
By following the last comment in that thread I was able to get a custom calendar rendered, but it took away all of the default functionality and broke my bindings etc... Is it not possible for me to just overwrite the styles of those cells while keeping everything else using the defaults?
I have SelectedDate as a bound value, and I'm using EvaluateCellStyle function to add a background color to certain cell dates based on my data, so I don't want to break those while changing the styling of those few cells.
Thank you