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

Events Not Showing in Calendar

Asked by Anthony
6 years ago.

I am loading both the Resources and the Events from SQL Server and already had this working in the Scheduler control. When binding in the Page_Load for the Calendar control, I have verified that data is coming back in the debugger but the events are not displaying. Am I missing something?

protected void Page_Load(object sender, EventArgs e)
{
DayPilotCalendar1.StartDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month,
DateTime.Today.Day);

DateTime endDate = DayPilotCalendar1.StartDate.AddHours(22.00);
int days = (int)Math.Ceiling((endDate - DayPilotCalendar1.StartDate.AddHours(6.00)).TotalDays);
DayPilotCalendar1.Days = days;

if (!IsPostBack)
{
LoadResources();

SchedulerDALC dalc = new SchedulerDALC();
DayPilotCalendar1.DataSource = dalc.GetEvents(DayPilotCalendar1.StartDate, DayPilotCalendar1.Days);
DayPilotCalendar1.DataBind();
}
}

Comment posted by Anthony
6 years ago.

When debugging server-side, I see the following when I hover over "DayPilotCalendar1.DataBind()":

DayPilotCalendar1.CallBackErrorJavaScript

alert('An exception was thrown in the server-side event handler:\n\n' + result.substring(result.indexOf('$$$')+3));

Comment posted by Anthony
6 years ago.

Got this in the Firefox console:

XML Parsing Error: no root element found
Location: http://localhost:1124/76364052b425456d894c6ac6b8c5375f/browserLinkSignalR/abort?transport=webSockets&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAAASMLu48XNUunq8lJ3OkzcAAAAAACAAAAAAADZgAAwAAAABAAAAA8OGks6GZJ3F9PpsaTxDFzAAAAAASAAACgAAAAEAAAALS1FjKDS9VEGiRk6flSI1UoAAAA47Aodkj5bVzpriPfu9Y2S0fizzXFio1MhZJyw1s9IxtUuMDiflXVDxQAAACqOfE5v4bRigS0nW03atYiHWWQYQ%3D%3D&requestUrl=http%3A%2F%2Flocalhost%2FScheduler%2FCalendar&browserName=Firefox&userAgent=Mozilla%2F5.0+(Windows+NT+10.0%3B+Win64%3B+x64%3B+rv%3A60.0)+Gecko%2F20100101+Firefox%2F60.0
Line Number 1, Column 1: abort:1:1

Comment posted by Anthony
6 years ago.

Ignore the XML error - it went away when I disabled browserlink in VS. In the client debug console, I can see the v.events.list is being populated with three events from the DB but nothing is rendering.

Comment posted by Anthony
6 years ago.

Here's the ASPX markup causing the error. If I change the value of ViewType to Day, the events show up. But of course I need the resources showing on top...

<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server"
ViewType="Resources" DataResourseField="resource"
DataColumnField="name"
DataEndField="eventend"
DataStartField="eventstart"
DataTextField="name"
DataValueField="id"
DataIdField="id"
TimeRangeSelectedHandling="JavaScript"
TimeRangeSelectedJavaScript="alert(start + ' ' + end + ' ' + resource); dpc.clearSelection();"
OnTimeRangeSelected="DayPilotCalendar1_TimeRangeSelected"

EventResizeHandling="Notify"
EventMoveHandling="Notify"
EventClickHandling="JavaScript"

EventMoveJavaScript="alert('resource: ' + e.resource());"
OnEventResize="DayPilotCalendar1_EventResize"
ClientObjectName="dpc"
OnBeforeCellRender="DayPilotCalendar1_BeforeCellRender"
OnEventMove="DayPilotCalendar1_EventMove"

BusinessBeginsHour="6"
BusinessEndsHour="22"
HeightSpec="BusinessHoursNoScroll"
ShowCurrentTime="false"
TimeFormat="Clock12Hours"
CellHeight="30">
</DayPilot:DayPilotCalendar>

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