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

Show just one shape when having multiple Events on date

3 Answers 83 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Eric
Top achievements
Rank 1
Eric asked on 19 Aug 2015, 10:25 AM

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.

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 19 Aug 2015, 10:46 AM
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
0
Eric
Top achievements
Rank 1
answered on 19 Aug 2015, 10:51 AM

Hi Jack,

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

 

Regards,

Eric

0
Jack
Telerik team
answered on 19 Aug 2015, 10:54 AM
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
Tags
Calendar
Asked by
Eric
Top achievements
Rank 1
Answers by
Jack
Telerik team
Eric
Top achievements
Rank 1
Share this question
or