DayPilot Forums

DayPilot is the best open-source Outlook-like calendar control for ASP.NET.
DayPilot Pro Demo (Calendar control)
» DayPilot Pro live demo (Calendar control)
DayPilot Pro Demo (Scheduler control)
» DayPilot Pro live demo (Scheduler control)
Home » How To » How do I refresh the dataset with refreshCallBack

How do I refresh the dataset with refreshCallBack

Hello,

Right now, I'm loading an entire year's events in the dataset for my calendar. Then I have "Next Week" "Previous Week" buttons to jump from week to week using the javascript:refresshCallBack command.

My question is: how do I load only one week at a time in the dataset, rather than the whole year? Is this something I do in the cal_Refresh method?

Thank you
Doug - 7/2/2008 7:46:47 PM
You need to rebind - using DayPilotCalendar.DataBind() - every time you make a change to the event set. That means typically:
  • In Page_Load in if (!IsPostBack) section.
  • After moving, resizing, deleting... the event. That is inside EventMove, EventResize, EventDelete event handlers, right after updating your database.
  • In Refresh event handler (after switching the Date).
In all cases, you should limit your selection to the time range determined by DayPilotCalendar.StartDate and DayPilotCalendar.EndDate.

For an example SELECT query, see
http://forums.daypilot.org/Topic.aspx/208/daypilot_sql_sample_application
Dan Letecky - 7/3/2008 8:47:38 PM
Post reply