Customizing Display of Inline Events

2 posts, 0 answers
  1. Trey
    Trey avatar
    2 posts
    Member since:
    Sep 2015

    Posted 13 Jan 2016 Link to this post

    Going off of the information from, I was wondering if the inclusion of the EventsManager() for customizing the display of events allows us to add more fields to the inline event display to include fields other than start time, end time, and subject? And if so, can anyone provide an example?
  2. Todor
    Todor avatar
    798 posts

    Posted 15 Jan 2016 Link to this post

    Hi Trey,

    Yes, you can add custom information to your events and show it with inline events mode. Here's how:

    1. Extend the Event class to include your custom information:

    public class ExtendedEvent : Event {
        public ExtendedEvent(String title, String content, long start, long end) :
                base(title, start, end) {
            this.Content = content;
        public String Content {

    2. Add a layout file that describe the template for the extended event:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android=""
            android:minEms="4" />
            android:minEms="4" />
            android:textSize="20sp" />

    3. Extend ArrayAdapter to actually inflate your layout resource file:

    public class MyAdapter : ArrayAdapter<Com.Telerik.Widget.Calendar.EventsManager.EventInfo> {
        public MyAdapter(Context context, int resource)
            : base(context, resource) {
        public override View GetView (int position, View convertView, ViewGroup parent)
            View view = convertView;
            if(view == null) {
                view = LayoutInflater.From (Context).Inflate (Resource.Layout.event_layout, parent, false);
            Com.Telerik.Widget.Calendar.EventsManager.EventInfo eventInfo = GetItem (position);
            ((TextView)view.FindViewById (Resource.Id.event_start)).Text = eventInfo.StartTimeFormatted ();
            ((TextView)view.FindViewById (Resource.Id.event_end)).Text = eventInfo.EndTimeFormatted ();
            ((TextView)view.FindViewById (Resource.Id.event_title)).Text = eventInfo.Title ();
            ((TextView)view.FindViewById (Resource.Id.event_content)).Text = ((ExtendedEvent)eventInfo.OriginalEvent ()).Content;
            return view;

    4. Create a few events and set an instance of the new adapter to the events manager:

    List<Event> events = new List<Event>();
    Calendar calendar = Calendar.Instance;
    events.Add(new ExtendedEvent("Test1", "Content1", calendar.TimeInMillis, calendar.TimeInMillis));
    events.Add(new ExtendedEvent("Test2", "Content2", calendar.TimeInMillis, calendar.TimeInMillis));
    calendarView.EventAdapter.Events = events;
    calendarView.EventsManager().Adapter = new MyAdapter(Context, Resource.Layout.event_layout);

    I hope this information helps.

    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
Back to Top