I wan't to implement CRUD operations on Schedule control, but somehow events are not triggering.
Here are two short snippets of my code, I have deleted some of it for easier reading, But full solution is attached in zip file.
Default.aspx.cs
protected EventRepository EventRepository { get; set; } = new EventRepository();
protected void Page_Load(object sender, EventArgs e)
{
Schedule.ServerAppointmentCreated += Schedule_ServerAppointmentCreated;
Schedule.ServerAppointmentSaved += Schedule_ServerAppointmentSaved;
BindEvents();
}
private void Schedule_ServerAppointmentSaved(object sender, ScheduleEventArgs e)
{
throw new NotImplementedException();
}
private void Schedule_ServerAppointmentCreated(object sender, ScheduleEventArgs e)
{
throw new NotImplementedException();
}
private void BindEvents()
{
Schedule.AppointmentSettings.DataSource = EventRepository.Get();
Schedule.DataBind();
}
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Naloga.Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Events</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel='nofollow' href="Content/ej/web/default-theme/ej.web.all.min.css" rel="stylesheet" />
<link rel='nofollow' href="Content/ej/web/ej.widgets.core.min.css" rel="stylesheet" />
<script src='<%= Page.ResolveClientUrl("~/Scripts/jquery-1.10.2.min.js")%>' type="text/javascript"></script>
<script src='<%= Page.ResolveClientUrl("~/Scripts/jsrender.min.js")%>' type="text/javascript"></script>
<script src='<%= Page.ResolveClientUrl("~/Scripts/jquery.easing.1.3.min.js")%>' type="text/javascript"></script>
<script src='<%= Page.ResolveClientUrl("~/Scripts/globalize.js")%>' type="text/javascript"></script>
<script src='<%= Page.ResolveClientUrl("~/Scripts/ej/ej.web.all.min.js")%>' type="text/javascript"></script>
<script src='<%= Page.ResolveClientUrl("~/Scripts/ej/ej.webform.min.js")%>' type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<ej:Schedule ID="Schedule"
runat="server">
<AppointmentSettings Id="Id"
Subject="Name"
StartTime="From"
EndTime="To"
Description="Description" />
</ej:Schedule>
</div>
</form>
</body>
</html>
Attachment:
EventTriggering_bd104a0c.zip