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

Custom cell on Android

4 Answers 66 Views
Calendar & Scheduling
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 27 Apr 2018, 05:40 PM

On iOS I can create a calendar delegate that returns a custom cell.

How do I do this on Android? I can't find the equivalent types.

4 Answers, 1 is accepted

Sort by
0
Ian
Top achievements
Rank 1
answered on 27 Apr 2018, 09:42 PM
In particular, I would like to draw in a cell.
0
Ian
Top achievements
Rank 1
answered on 27 Apr 2018, 11:36 PM

I appear to have found it...

public class MyCalendarRenderer : CalendarRenderer
{
   protected override void OnElementChanged(ElementChangedEventArgs<RadCalendar> e)
   {
      base.OnElementChanged(e);
 
      Control.Adapter = new MyAdapter(Control);
   }
}
 
public class MyAdapter : CalendarAdapter
{
   public MyAdapter(RadCalendarView view) : base(view)
   {
   }
 
   protected override CalendarDayCell GenerateCalendarDayCell() => new MyCell(Owner);
}
0
Ian
Top achievements
Rank 1
answered on 28 Apr 2018, 12:56 AM

I spoke too soon. My custom adapter isn't initialized properly. Now, for example, the month names are missing.

How do I initialize an adapter?

0
Stefan Nenchev
Telerik team
answered on 01 May 2018, 01:54 PM
Hi, Ian,

Please check the following article regarding the native Android Calendar - RadCalendarView Customizations. More specifically, you can have a look at the Defining set of customization rules part.

Regards,
Stefan Nenchev
Progress 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
Ian
Top achievements
Rank 1
Answers by
Ian
Top achievements
Rank 1
Stefan Nenchev
Telerik team
Share this question
or