November Happy Hour will be moved to Thursday December 5th.

Duplicate events in EPiServer:Calender

Vote:
 

Hello. I am currently developing a calendar function in an existing EPiServer website (CMS 7 using Webforms). The calendar is built using asp:calendar as the "month view" and when the user selects a date a EPiServer:Calendar displays the events. This works fine when I select a single day, however when I select a week or month same event are displayed multiple times. Those events lasts for more than a day.

I have tried search Google, this forum and the sdk with no result. I have seen that this question have been asked before but I cannot find a single thread with an answer.

So how can I filter the events so they are just shown once?

Thanks in advance,

David Rutqvist 

#73652
Aug 05, 2013 8:25
Vote:
 

Hi,

There is no built-in functionality for this. You have to filter out recurring events by yourself. There is a Filter method in the EPiSerer Calendar control where you can do this.

#73671
Aug 05, 2013 15:20
Vote:
 

I did try that earlier but it didn't change anything, perhaps I did something wrong.

@ OnLoad

EventsList.Filter += new FilterEventHandler(SelectedDatesFilter);
EventsList.DataSource = EventsCollection;

And then the actual filter

protected void SelectedDatesFilter(object sender, FilterEventArgs f)
{
    PageDataCollection Pages = f.Pages;
    List<PageData> Passed = new List<PageData>();
    foreach (PageData Page in Pages)
    {
        if (Passed.Contains(Page))
        {
            Pages.Remove(Page);
        }
        else
        {
            Passed.Add(Page);
        }
    }
}

    

In the asual FilterEventArgs (System.Windows.Data) you set the Accepted-property but EPiServer's FilterEventArgs only contains a definition for Pages. How to set if the page is accepted or does EPiServer fix this by itself?

 

EDIT: That actually does not make any change. There are no duplicates. It must be in the rendering it occurs. Any thoughts about this? How to limit so each event is only printed at one day. Why I want to do this is because I print the date as "start date - end date" if the event spans over several days. This is the current result when I select a week (you will see what is wrong).

http://postimg.org/image/jtqau8bzn/

#73690
Edited, Aug 06, 2013 7:49
Vote:
 

I figured out that what I actually needed was not an EPiServer:Calender, instead I used a EPiServer:PageList since what I was trying to achieve was a list of events (pages). This solved all my problems.

#73695
Aug 06, 2013 11:00
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.