Show just one shape when having multiple Events on date

4 posts, 1 answers
  1. Eric
    Eric avatar
    16 posts
    Member since:
    May 2014

    Posted 19 Aug 2015 Link to this post

    Hi,

    I would like to have just one "shape" displayed when there are more then one Events on the date. Out of the box it shows as many shapes as there are Events. What property can I set or what method should I override?

    The quickest way is just to DataBind one event per date - but maybe there's a better solution.

     

    See attached image for an example. Three 'dots' are displayed, I would like to have just one 'dot' shown there.

     

    Many thanks in advance.

     

  2. Answer
    Jack
    Admin
    Jack avatar
    2335 posts

    Posted 19 Aug 2015 Link to this post

    Hi Eric,

    This can be done by setting the maxEventsCount property in TKCalendarDayCell style to 1. To do this you should adopt TKCalendarDelegate and implement its calendar:updateVisualsForCell: method. Consider the code snippet below:
    - (void)calendar:(TKCalendar *)calendar updateVisualsForCell:(TKCalendarCell *)cell
    {
        if ([cell isKindOfClass:[TKCalendarDayCell class]]) {
            TKCalendarDayCell *dayCell = (TKCalendarDayCell*)cell;
            dayCell.style.maxEventsCount = 1;
        }
    }

    I hope this helps.

    Regards,
    Jack
    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
  4. Eric
    Eric avatar
    16 posts
    Member since:
    May 2014

    Posted 19 Aug 2015 in reply to Jack Link to this post

    Hi Jack,

    Many many many thanks for this solution. Works like a charm (offcourse).

     

    Regards,

    Eric

  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 19 Aug 2015 Link to this post

    Hi Eric,

    I am glad that I was able to help. Do not hesitate to contact us if you need further assistance.

    Regards,
    Jack
    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
Back to Top
DevCraft banner