Home Unanswered Active Tags New Question

Calendar Items property

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?

Asked by Phil 1 year ago.
1 other person also wants an answer.
Replies

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 Dan Letecky 1 year 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?

Comment posted by Gary 8 months 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.

Answer posted by Dan Letecky [DayPilot] 8 months ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java