Retreiving Recurring Events from a SharePoint Calendar list

I thought it would be useful to post an entry on how to retrieve recurring events from a calendar list. If you ever had to display recurring events, you probably noticed no list items are created for those events in the calendar list.

In order to display those items, I had to do a bit of digging… I noticed that the "Current Events" view from the calendar list would display those recurring events giving the illusion that they were actual unique list items.

Using SharePoint Solution Generator 2008 (as part of the extension for Visual Studio 2008 that can be downloaded here), I extracted the schema.xml that includes all the views including the "Current Events" to see how those events were being retrieved:

The RecurrenceID field identifies a specific instance of a recurring event and its value represents the starting date and time of a specific instance.

In my code, I re-used the query from the view and set as well the SPQuery.ExpandRecurrence property to true:

About the Author

More from this Author

Thoughts on “Retreiving Recurring Events from a SharePoint Calendar list”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up