- Home
- Forum
- ASP.NET Core - EJ 2
- Can't show events with DataManager
Can't show events with DataManager
Hello,
Attachment: EssentialJS2WebApplication4_b0969dba.rar
I created a sample with scheduler and I added dataManager and some schedule data with the help of asp.net core Data Binding tutorial. But my data doesn't show on the calendar. Can you help me figure this out?
the View:
@using Syncfusion.EJ2;
@using Syncfusion.EJ2.Schedule;
@{
var dataManager = new DataManager()
{
Url = "GetData",
Adaptor = "UrlAdaptor",
CrossDomain = true
};
}
@{
ViewBag.Title = "Schedule";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Schedule Features:</h2>
<br />
<li> Schedule Samples - Default</li>
<li> Theme - Bootstrap-Theme</li>
<br />
<div id="ControlRegion">
<ejs-schedule id="schedule" height="550px" selectedDate="new DateTime(2018, 2, 15)">
<e-schedule-eventsettings dataSource="dataManager"></e-schedule-eventsettings>
</ejs-schedule>
</div>
controller:
[HttpPost]
public JsonResult GetData()
{
var data = new ScheduleData().GetScheduleData();
return Json(data);
}
public ActionResult ScheduleFeatures()
{
return View();
}
public class ScheduleData
{
public List<AppointmentData> GetScheduleData()
{
List<AppointmentData> appData = new List<AppointmentData>();
appData.Add(new AppointmentData
{
Id = 1,
Subject = "Explosion of Betelgeuse Star",
StartTime = new DateTime(2018, 2, 11, 9, 30, 0),
EndTime = new DateTime(2018, 2, 11, 11, 0, 0),
CategoryColor = "#1aaa55"
});
appData.Add(new AppointmentData
{
Id = 2,
Subject = "Thule Air Crash Report",
StartTime = new DateTime(2018, 2, 12, 12, 0, 0),
EndTime = new DateTime(2018, 2, 12, 14, 0, 0),
CategoryColor = "#357cd2"
});
return appData;
}
public class AppointmentData
{
public int Id { get; set; }
public string Subject { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public string CategoryColor { get; set; }
}
}
}
Attachment: EssentialJS2WebApplication4_b0969dba.rar
SIGN IN To post a reply.
1 Reply
VD
Vinitha Devi Murugan
Syncfusion Team
November 4, 2019 10:28 AM UTC
Hi theofilos,
Syncfusion Greetings.
We have checked the reported problem with your shared sample which was due to casing issue in the Json datasource. The issue can be overridden by using the following line in Startup.cs file and same can be available in below link.
services.AddMvc()
.AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());
Reference Link: https://stackoverflow.com/questions/38202039/json-properties-now-lower-case-on-swap-from-asp-net-core-1-0-0-rc2-final-to-1-0
Regards,
M.Vinitha devi
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
DI Dimitris
- Nov 1, 2019 10:21 AM UTC
- Nov 4, 2019 10:28 AM UTC