search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Calendar Items property

Asked by Phil
13 years ago.

I've just switched from DayPilot 6.1 to 6.4. The only breaking change I encountered was the reduced access to the Items property of the Calendar control. I was previously using the property to check for the existence of events in the calendar and also to clear all the events. Now the Items property cannot be accessed, so is there another way I can carry out these actions?

Comment posted by Dan Letecky
13 years ago.

Exposing the Items property in the past was rather unintentional. It contains a list of Event classes while this class is marked as internal and is not accessible anyway.

I will make it accessible in the next release (6.5), together with exposing the Event class, but it needs to be checked for dependencies first.

Comment posted by Gary
13 years ago.

I've inherited this code from Phil, and have finally updated to DayPilot 6.5 SP1. However, I have noticed that the Items collection is still not available as described above. Is there anything else in this new build which addresses Phil's above request or should I go ahead and implement a work around to check for events and to clear events from the Calendar control?

Answer posted by Dan Letecky [DayPilot]
13 years ago.

Unfortunately, this change was not included in 6.5. I've put it in the plan for the next release.

Meanwhile, I'd like to comment it a little bit.

The Items collection stores events loaded from the DataSource during data binding. It's ok to check it after it's loaded (after calling DataBind(), that includes BeforeEventRender and BeforeCellRender events).

Up to 6.2 release, the loaded events were stored in the ViewState and available during PostBacks and CallBacks even before DataBind() was called. In 6.2, a new property was added to control this behavior (StoreEventsInViewState). The default value is false.

I'm not sure if it's your case but I would strongly recommend not storing the events in the ViewState. It will be much faster to query the database than to send the full event set back and forth with every server call.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.